C program to print Floyd\'s triangle
belongs to collection: Sum of series programs/examples in C programming language
All Answers
total answers (1)
belongs to collection: Sum of series programs/examples in C programming language
total answers (1)
Read the total number of rows from the user, and then print Floyd's triangle.
Floyd's triangle:
Floyd's triangle is a triangular array of natural numbers. In this triangle, the rows of the triangle are filled with consecutive natural numbers, starting with a 1 in the top left corner.
Example:
Program:
The source code to print Floyd's triangle is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
Output:
Explanation:
Here, we read the total number of rows from the user and then printed Floyd's triangle using the nested loop on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer