Have a Read!

Hi Everyone.
The idea for this page is to provide new c users simple c tutorials to learn how to develop the logic and more importantly correct way to write syntax.
ENJOY !!!

Saturday, January 29, 2011

C PROGRAM FOR PYRAMID

#include<stdio.h>
int main()
{
    int counter,x,y,z;
        counter=0;
    for(x=15;x>=1;x--)
    {
        for(y=1;y<=x;y++)
        {
            printf(" ");
        }
                counter=counter+1;
            for(z=1;z<=counter;z++)
                {printf("* ");}
                printf(" \n");}
return 0;
}

No comments:

Post a Comment

Related Posts with Thumbnails