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 HOLLOW TRIANGLE

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

No comments:

Post a Comment

Related Posts with Thumbnails