Showing posts with label Pyramid in C. Show all posts
Showing posts with label Pyramid in C. Show all posts

Wednesday, March 22, 2017

Side Pyramid Image in C

Hello there in this article I would like to share with you a sample program that will display side pyramid in C. The code uses two for loop statements to create the side pyramid image in C. I hope you will like my work. I am using CodeBlocks as my text editor and Dev C++ as my C/C++ compiler in this sample program. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output

Program Listing

#include <stdio.h>
#include <conio.h>
#include <math.h>

/* Side Pyramid Image                                              */
/* Written By: Mr. Jake R. Pomperada, MAED-IT  */
/* March 22, 2017                                                  */

int main()
{

    int size=5;
    int a=0,b=0;

     printf("SIDE PYRAMID IMAGE ");
     printf("\n\n");
     for (a=size; a>=-size; a--) {
        for (b=size; b >= abs(a); b--) {
            printf("*");
        }
      printf("\n");
     }
    printf("\n\n");
    printf("End of Program");
    printf("\n\n");
}