UPSC PRELIMS 2020

Search This Blog

Wednesday, 12 March 2014

PYRAMID PROBLEM IN C PROGRAMMING LANGUAGE BEST WITH OUTPUT SCEENSHOT

#include
int main()

{
    int i,j,n;
printf("Enter lines : ");
scanf("%d",&n);
for(i=1; i<=n; i++)  /*for printing lines or rows only*/
{
for(j=1; j<=i; j++)/*this loop used for printing values inside the lines or rows*/
printf("%2d",i);
printf("\n");
}
return 0;
}


OUTPUT:



                             

No comments:

Post a Comment