UPSC PRELIMS 2020

Search This Blog

Wednesday, 12 March 2014

PYRAMID PROBLEM IN C PROGRAMMING LANGUAGE WITH OUTPUT SCREEN SHOT

#include

int main()
{
    int i,j,n;
printf("Enter lines : ");
scanf("%d",&n);
for(i=1; i<=n; i++) /*This used for printing row only*/
 {
 for(j=1; j<=i; j++)/*This used for printing ASTERISK IE.* only*/
         {
  printf("* ");
                 }


printf("\n");

   }

return 0;

}


OUTPUT:




No comments:

Post a Comment