The Famous Right Triangle Program:
#include<stdio.h>
#include<conio.h>
main()
{
int height, counter, cntra;
printf("Enter height of triangle: ");
scanf("%i", &height);
for (counter=1; counter<=height; counter++) { for(cntra=1;cntra<=counter; cntra++)
printf("*");
printf("\n");
}
getch();
return 0;
}
OUTPUT:
*
**
***
****
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment