R4R
Right Place For Right Person TM
 
R4R C C ExamplesReverse Star Triangle
previous

Home

Next

Learn C with example

Reverse Star Triangle

In this example we are going to print reverse star triangle using C

In this example we are print *******..n in first line,******..n-1 in second line,*******..n-2 in third line so on...

 

 

Source Code of the Example

/* Rreverse of triangle  */
#include<stdio.h>                  /*      * * * * *        */
#include<conio.h>                  /*      * * * *          */
void main()                        /*      * * *            */
{                                  /*      * *              */
int i,j,n;                         /*      *                */
clrscr();
printf("Enter a number\t:");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
printf("*");
printf("\n");
}
getch();
}

Output Of Example

Enter a number :5

 * * * * *
 * * * *
 * * *
 * *
 * 

previous

Home

Next

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R