Codes
Answers
#include <stdio.h>
int main()
{
int height,space,i,j,k;
printf("Enter the height of the triangle: ");
scanf("%d",&height);
space=height;
for( i=1;i<=height;i++)
{
for( j=1;j<space-1;j++)
{
printf(" ");
}
for( k=1;k<=2*i-1;k++)
{
printf("*");
}
space--;
printf("\n");
}
return 0;
}
Questions
Answers
Answer accepted
Users
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us