0
Why my code is not working?
Link to my code : https://code.sololearn.com/cP3cLFaBkqlQ/?ref=app
3 Answers
+ 2
#include <stdio.h>
int main()
{
int n,x,y;
scanf("%d",&n);
for(x=1;x<=n;x++)
{
for(y=1;y<=x;y++){
printf("*");
}
printf("\n");
}
for(x = n; x >= 1; x--)
{
for(y = 1; y <= x; y++)
{
printf("*");
}
printf("\n");
}
return 0;
}
đđ
+ 1
My desired output is
*
* *
* * *
* * * *
* * * * *
* * * * *
* * * *
* * *
* *
*
+ 1
Coder kay
My coding is running correctly now you can see it