Monday, July 15, 2024
HomeC#Program to generate Floyd’s Triangle in C# ~ IT Tutorials with Instance

Program to generate Floyd’s Triangle in C# ~ IT Tutorials with Instance


Floyd’s triangle is a right-angled triangle of pure numbers utilized in laptop science training. Floyd refers back to the title after Robert Floyd. Floyd’s triangle is created by printing the consecutive numbers within the rows of the triangle ranging from the number one on the high left nook.

I’ll suggest you to test the under hyperlink for Prime C# Interview Applications requested in the course of the Interview and Examination.

Program:

//Three variable one for outer loop, one for inside

//okay to print the quantity

int i, j, okay = 1;

for (i=1;i<=10;i++) {

    for (j=1;j<=i;j++) {

    //Print no. in console with horizontal house i.e. tab

    Console.Write(okay++ + “t”);

    }

    //New Line

    Console.Write(“n”);

}

//Console.ReadLine() to carry the display screen after the execution of
this system

Console.ReadLine();

Preview:

I hope this program will assist you in your examination in addition to Interview preparation.

Thanks

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments