Logo 
Search:

C Programming Article

Submit Article
Comments on Program to print triangle of * stars in reverse pattern
Category: C Programming (Homework Help)    Author: Jawwad Akram

Program to print triangle of * stars in reverse pattern


* * * * *
__* * * *
____* * *
______* *
________*


Muneeb Ahmed
Muneeb Ahmed from PakistanApr 07
#include<stdio.h>
#include<conio.h>
void main(void)
{
int a,b,c,d=0,n;
scanf("%d",&n);
clrscr();
for(a=1;a<=n;a++)
{
for(b=n;b>=a;b--)
{
printf(" ");
}
for(c=1;c<=a+d;c++)
{
printf("*");

}
d++;
printf("\n");
}

getch();
}


Please enter your Comment
  • Comment should be atleast 15 Characters.
  • Please put code inside [Code] your code [/Code].