1.

To print the first 5 multiples of a number in a Java Program code.

Answer»

Class q1
{
PUBLIC void kd( int n)
{
DOUBLE a =0;
for (a=1;a <=5; a++)
{
double b = n*a;
System.out.println(" the "+ a + " multiples of " + n + " is ="+ b);
}
}
}



Discussion

No Comment Found