{ A destination to learn coding }

Printing Floyd's triangle *

1
2 3
4 5 6 
7 8 9 10

#include <stdio.h>
int main()
{
  int i,j,n=1,a;
  printf("Enter the number of rows\n");
  scanf("%d",&a);
  for(i=0;i<a;i++)
  {
    for(j=0;j<=i;j++)
    {
      printf("%d ",n);
      n++;
    }
    printf("\n");
  }

  return 0;
}