#Pyramid With A Constant Special Char in the middle
4 messages · Page 1 of 1 (latest)
#include<stdio.h>
int main()
{
int n=5;
for (int i=1; i<=n; i++) //row
{
for(int j=1; j<=2*n; j++)
{
if(j<(n-i+1))
printf(" ");
else if(j==n)
printf("+");
else if(j<n)
printf("*");
else if(j>n&&j<=n+i-1)
printf("*");
}
printf("\n");
}
return 0;
}
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.
!solved