0
Help me i wanna print hollow triangle
For loop in c https://code.sololearn.com/c8U9jh0tkf9K/?ref=app
5 Answers
+ 2
Sorry
+ 1
Write hollow triangle in between printf(" ");
+ 1
Coded_cat change line 20 to if(i==5||j==0||i==j) and line 23 to
Printf(" ")
change for loop test conditions to i<5 and j<5
+ 1
try this.
#include <stdio.h>
int main()
{
for (int i = 0; i <= 4; i++)
{
if (i == 4)
for (int k = 0; k <= i; k++)
printf("@");
else
printf("@");
for (int j = 1; j <= 3; j++)
{
if (i == j)
printf("@");
else
printf(" ");
}
printf("\n");
}
return 0;
}
0
Hahah that's not what i want Sohanur Rahman look at the code first