Computer Science, asked by satyant123, 1 year ago

write a program to print first 15 multiples of 6.

Answers

Answered by vidyasagar05
0

import java.util.*;

public class HW5Problem3 {

  public static void main (String [] args) {

     int i = 0;

     int n = 0;

     Scanner input = new Scanner(System.in);

        System.out.print("Enter i: ");

        i = input.nextInt();

        System.out.print("Enter n: ");

        n = input.nextInt();

        if ((i <= 1) || (n <= 1)) {

           System.out.println("Please enter numbers above 1");

           System.exit(1);

        }

        System.out.print(n + " multiples of " + i + " are: ");

  }

}

Answered by MAJU03
0

class P1

{

public static void main()

{

int i,p;

for(i=1;i<=15;i++);

p=6*i;

System.out.println("The 15 multiples of 6 are"+p);

}

}

Similar questions