C Program to Print Half Traingle of Numbers

Write a C program to print half triangle of numbers or digits. This C program accepts the number of rows and prints the half traingle of digits or numbers.

C Program to Print Half Triangle of Numbers or Digits

#include<stdio.h>

int main()
{
	int i,j,c=1;

	printf("\n");

	for(i=1;i<=3;i++)
	{
		for(j=1;j<=i;j++)
		printf("  %d",c++);
		printf("\n \n");	}

}

/* Output of above code:-

  1
 
  2  3
 
  4  5  6 */