Friday, June 18, 2021

program in Java to display the multiplication table of a given integer (Java) (191)

package com.company;
import java.util.Scanner;
public class Program28 {
public static void main(String[] args) {
Scanner put = new Scanner(System.in);
System.out.println("please enter the number of terms for checking cube:");
int n = put.nextInt();
for(int i=1;i<=10;i++)
{
System.out.print(n);
System.out.print(" x");
System.out.print(i);
System.out.print(" = ");
int res=n*i;
System.out.println(res);
}
}
}

No comments:

Post a Comment