Skip to content

Instantly share code, notes, and snippets.

@Kishanjvaghela
Created February 11, 2016 07:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kishanjvaghela/8ef690533f7be5980f8b to your computer and use it in GitHub Desktop.
Save Kishanjvaghela/8ef690533f7be5980f8b to your computer and use it in GitHub Desktop.
Program to print number 1..n as right triangle.
#include <stdio.h>
int main(void) {
int i,j,rows;
printf("Enter the nth number of series: ");
scanf("%d",&rows);
printf("\n");
for(i=1;i<=rows;++i)
{
for(j=1;j<=i;++j)
{
printf("%d ", j);
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment