0

Why my code is not working?

Link to my code : https://code.sololearn.com/cP3cLFaBkqlQ/?ref=app

11th Jun 2022, 4:37 PM
Abhishek Shelar
Abhishek Shelar - avatar
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; } 🙂👍
11th Jun 2022, 4:52 PM
Coder Kay
Coder Kay - avatar
+ 1
My desired output is * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11th Jun 2022, 4:43 PM
Abhishek Shelar
Abhishek Shelar - avatar
+ 1
Coder kay My coding is running correctly now you can see it
11th Jun 2022, 4:46 PM
Abhishek Shelar
Abhishek Shelar - avatar