Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Thursday, 31 January 2013

C PROGRAM: TO PRINT TRIANGLE OF STARS

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,p,s;
clrscr();
for(i=1;i<=5;i++)
{
 p=i;
 for(s=1;s<=6-i;s++)
 {
  printf("   ");         /* three spaces */
 }
 for(j=1;j<=(2*i-1);j++)
 {
  printf("  *");          /* two spaces */
 }
printf("\n\n");
}
getch();
}


CODING

OUTPUT
For any query or suggestion please comment below...

No comments:

Post a comment