Computer Science, asked by dipamcool2016, 6 months ago

Write a program in java to input a number and print the result of the first 6 multiples of that number. Please don't spam or give irrelevant answers.

Answers

Answered by anindyaadhikari13
3

Correct Question:-

Write a program in java to input a number and print the first 6 multiples of that number.

Program:-

import java.util.*;

class Multiple

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("Enter a number: ");

int a=sc.nextInt();

System.out.println("First 6 multiples are... ");

for(int i=1;i<=6;i++)

System.out.println(i*a);

}

}

Answered by BrainlyProgrammer
2

Answer:

This is an extract of answer to ur question

int n=sc.nextInt() ; //input a number

System.out.println ("First 6 multiples are.. ") ;

for(I=1;I<=6;I++)

{

System. out. println (n+"×"+I+"="+(n*I)) ;

}

Explanation:

Output will be as follows....

6×1=6

6×2=12

.

.

.

6×6=36

Similar questions