Sunday, 11 December 2011

Write a program to print a back triangle in c

#include
#include
main()
{
int n,i,j;
clrscr();
printf("Enter The Number:");
scanf("%d",&n);
for(i=n+1;i>0;i--)
{
for(j=0;j {
printf("*");
}
printf("\n");
}
getch();
}

OUTPUT:-
Enter The Number: 5
*****
****
***
**
*

No comments:

Post a Comment