Thursday, 16 February 2017

First n Multiplies of given number

Q : Write a program to display First n Multiplies of given number?

Solution : 


class Multiples {
 void Multi(int n) {
  int d;
  for (d = 1; d <= n; d++) {
   System.out.println(d * n);
  }
 }
}

No comments:

Post a Comment