-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfor40.java
More file actions
28 lines (23 loc) · 567 Bytes
/
for40.java
File metadata and controls
28 lines (23 loc) · 567 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package fori;
import java.util.Scanner;
public class for40 {
public static void main(String[] args) {
int a;
int b;
Scanner scanner=new Scanner(System.in);
System.out.print("A:");
a = scanner.nextInt();
System.out.print("B:");
b = scanner.nextInt();
int i;
int i2;
for (i = 1; i <= b - a + 1; ++i)
{
for (i2 = 1; i2 <= i; ++i2)
{
System.out.print(a + i - 1);
System.out.print(" ");
}
}
}
}