write a program to display output
Attachments:
Answers
Answered by
0
Answer:
i=1
c=1
while i<=5:
j=1
while j<=i:
print(c,end=" ")
c+=1
j+=1
i+=1
print()
This will work for sure.
NOTE: I have written answer in python code. If you want any other language, then sorry.
Answered by
0
public class FloydsTriangle {
public static void main(String[ ] args) {
for (int i = 0, number = 1; i < 5; i++) {
for (int j = 0; j <= i; j++, number++)
System.out.print(number + " ");
System.out.println( );
}
}
}
Similar questions