C Program to Print Floyd’s Triangle

C Program to Print Floyd’s Triangle

Program to print floyd’s triangle in c; Through this tutorial, we will learn how to print floyd’s triangle in c program.

C Program to Print Floyd’s Triangle

#include <stdio.h>

int main() 
{
  int Rows, i,  j, Number = 1;

  printf(" Please Enter the Number of Rows:  ");
  scanf("%d", &Rows);
	
  printf(" \n Printing FLOYD'S Triangle \n \n");
  for ( i = 1 ; i <= Rows; i++ ) 
    {
	for ( j = 1 ; j <= i; j++ ) 
         {
	   printf("%d ", Number);
	   Number++;
	 }
	printf("\n");
     }
  return 0;
}

The output of the above c program; is as follows:

Please Enter the Number of Rows:  5
Printing FLOYD'S Triangle 
 
1 
2 3 
4 5 6 
7 8 9 10 
11 12 13 14 15 

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *