Isosceles Triangle:
#include<stdio.h>
#include<conio.h>
int main()
{
int cntro,cntra,cntri, height=0;
printf("Enter height of pyramid: ");
scanf("%i",&height);
for(cntro=1;cntro<=height;cntro++) { for(cntri=height;cntri>cntro;cntri–)
printf(" ");
for(cntra=1;cntra<=cntro;cntra++)
printf("* ");
printf("\n");
}
getch();
return 0;
}
OUTPUT:
(A TRIANGLE OF ASTERISK(*))
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment