Write a program that will output the multiples of a number. Arrange it from lowest to highest.
Sample Output:
Source Codes:
package javaapplication1;
import java.io.*;
public class Multiple {
public static BufferedReader q= new BufferedReader(new InputStreamReader (System.in));
public static void main(String []args)throws IOException{
System.out.print("Enter a Number: ");
String a=q.readLine();
int b=Integer.parseInt(a);
for (int x=1; x int y;
y=b%x;
if (y==0)
{
System.out.println(x);
}
}
}
0 comments:
Post a Comment