We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Introduction
- Java Loops I
- Discussions
Java Loops I
Java Loops I
+ 0 comments Scanner sc= new Scanner(System.in); int firstnum =sc.nextInt(); for(int i=1; 0<firstnum&&i<=10;i++){ System.out.println(firstnum+" x "+i+" = "+ firstnum*i);
+ 0 comments for(int i=1;i<=10;i++) { System.out.println(N+" x "+i+" = "+(N*i)); }
+ 0 comments if(N<=20 && N >=2) { for (int i = 1; i <= 10; i++){ System.out.println(N+" x " + i +" = " + (N *i)); } }
+ 0 comments import java.util.*; public class Table{ public static void main (String[] args) { int b=0; Scanner sc = new Scanner(System.in); System.out.println("enter the number"); int a = sc.nextInt(); System.out.println("enter the range"); int r = sc.nextInt(); for( int i=1;i<=r;i++){ b=a*i;
System.out.println(a+" x " + i +" = " +b); // System.out.printf("%d * %d = %d \n" a,i,a*i); this can aslo be used for printing our output } }
}
+ 0 comments int N = new Scanner(System.in).nextInt(); for (int i = 1; i < 11; i++) System.out.printf("%d x %d = %d%n", N, i, N*i);
Load more conversations
Sort 1150 Discussions, By:
Please Login in order to post a comment