Tuesday, 27 August 2013

Reverse L-Shape Pyramid

Q. Write a C program to print the following Reverse L-Shape pyramid as:

*************
*
*
*
*
*
*
*


Ans.

/*c program for reverse L-shape pyramid*/
#include<stdio.h>
int main()
{
 int c;

 for(c=1; c<=13; c++)
    printf("*");
 for(c=1; c<=7; c++)
    printf("*\n");
 getch();
 return 0;
}

/**************************************************************
The output of above program would be:
**************************************************************/


Output of reverse L-Shape Pyramid C program
Figure : Screen shot for reverse L-Shape pyramid C program



No comments:

Post a Comment