Hello readers, today I have taken example of Floyds triangle. Floyd's triangle is a right-angled triangle of array having natural numbers. The natural numbers are printed in such a manner , that it will look like right angle triangle. It is named after Mathematician Robert Floyd. Floyd's triangle is made by filling the rows of the triangle with consecutive natural numbers, starting with 1 in the top left corner.
Comment : In the above example I took an inputbox, in which user entered a number, this number will assign to variable 'k'. Now I have applied for loop which will start from 0, and ends upto variable 'k'(user entered number). Inside for loop, I have used another for loop which will start from 1 and ends at the value of variable 'i'. Inside this loop I am printing variable 'a' whose starting value is 1 and then incrementing with the for loop.