Write a program in java to display the Floyd’s Triangle:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Answers
Answered by
1
Answer:
class Floyd. int n, num = 1, c, d; Scanner in = new Scanner(System. System. out. println("Enter the number of rows of floyd's triangle you want"); n = in. nextInt(); System. out. println("Floyd's triangle :-"); for ( c = 1 ; c <= n ; c++ ) for ( d = 1 ; d <= c ; d++ )
Similar questions