Program to multiply of n numbers in java programming.

Program to multiply of  n numbers in java programming:
import java.lang.*;
import java.io.*;
import java.util.*;
class MultiplynNumber
{
public static void main(String args[])
{
int num,value,i,mul=1;
Scanner s=new Scanner(System.in);
System.out.println("a3programming.blogspot.com");
System.out.println("Enter number howmany number do you want multipication :\t");
num=s.nextInt();
System.out.println("Enter numbers :");
for(i=1; i<=num; i++)
{
value=s.nextInt();
mul=mul*value;

}
System.out.println("Result :"+mul);
}
}
Expected output is:


Post a Comment

0 Comments