Java program that takes a number as input and prints its multiplication table upto 10. - BSC IT PRACTICALS

Monday, January 15, 2018

Java program that takes a number as input and prints its multiplication table upto 10.


CODE:     
                                                         
import java.util.*;
class prac1A
{
public static void main(String ar[])
{
int no,s=0,i;
Scanner ob=new Scanner(System.in);
System.out.print("Enter the Number: ");
no=ob.nextInt();
for(i=1;i<=10;i++)
{
s=no*i;
System.out.println(no+"*"+i+"= "+s);
}
}  }

No comments:

Post a Comment