C Programming Tutorial

 
 
 
 

Image

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,num,space,k;
clrscr();
printf(\"Enter the number:-\");
scanf(\"%d\",&num);
k=num;
for(i=num;i>=0;i--)
{

    for(space=k;space>0;space--)
   {
       printf(\" \");
   }

   for(j=num -(i-1);j>=1;j--)
   {



       printf(\"%d \",i);
   }
printf(\"\\n\");
k--;
}

getch();
}

 
 
Didn't find what you were looking for? Find more on Program that displays triangle based on provided number as an input