1.

WAP to display table of any number entered by the user at run time.​

Answer»

ong>Answer:

//ASSUMING it's Java programming

import java.util.*;

class Table{

public static VOID main (String AR []){

Scanner sc=new Scanner (System.in);

System.out.println("Enter a number");

int n=sc.nextInt();

for(int I=1;I<=10;I++){

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

}

}

}

Logic:-

  • Run a loop from 1 to 10
  • multiple the number input with I
  • print the product


Discussion

No Comment Found