Pattern Codes, ABCDE Code, Arduino Code

Saturday, 14 January 2017

Reverse Right Angle Triangle Star Pattern

Reverse Right Angle Triangle Star Pattern

Output:

Enter the number of your choice5

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

Code:

#include<stdio.h>

int main()
 {
int i,j,k, n;
printf("\n Enter the number of your choice");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(k=0;k<i;k++)
{
printf(" ");
}
for(j=n;j>i;j--)
{
printf("*");
}
printf("\n");
}
}

No comments :

Post a Comment

Rolls Royce

Rolls Royce
Amazing Cars

About Me