Skip to main content

Posts

Showing posts with the label 15. Write a Java program to calculate product of digits of a number.

ads1

15. Write a Java program to calculate product of digits of a number.

  15. Write a Java program to calculate product of digits of a number. Static :- class loop15 { public static void main(String args[]) { int n=12,mul=1; while(n!=0) { mul *= n%10; n=n/10; } System.out.println("mul is :- "+mul); } } Output :-

ads2