1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| /*Write a program to generate a Triangle.
eg:
1
2 2
3 3 3
4 4 4 4 and so on as per user given number */
class Triangle{
public static void main(String args[]){
int num = Integer.parseInt(args[0]);
for(int i=1;i<=num;i++){
for(int j=1;j<=i;j++){
System.out.print(" "+i+" ");
}
System.out.print("\n");
}
}
} |
/*Write a program to generate a Triangle.
eg:
1
2 2
3 3 3
4 4 4 4 and so on as per user given number */
class Triangle{
public static void main(String args[]){
int num = Integer.parseInt(args[0]);
for(int i=1;i<=num;i++){
for(int j=1;j<=i;j++){
System.out.print(" "+i+" ");
}
System.out.print("\n");
}
}
}
program are not run
What is this website how can i see the program because that the add there.
thankyou
i need output this way help me..
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
using nested for loop
only logic
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
Systam.out.print(i);
}
Systam.out.print("\n");
}
how to print **1**
*2*2*
3*3*3
*4*4*
**5**
how to print
**1**
*2*2*
3*3*3
*4*4*
**5**
please send me this answer if got from someothers
how to print below code
1
*
22
**
333
***
4444
****
i want to make loop –
a1
b3 b3 b3
c5 c5 c5 c5 c5
y7 y7 y7
z9
i need a output like this
1
123
123456
What is the programme for this output
1
22
333
4444
55555
try from urselves ass**les asking like beggers