9th Feb 2021, 6:42 PM
Ira Sarkar
Ira Sarkar - avatar
3 Respuestas
+ 7
there is variable "i"in for loop, that is not declared and initialized: should be x not i. for (x = 0, y = num; x < y; x++, y--) ^
9th Feb 2021, 6:51 PM
Lothar
Lothar - avatar
+ 5
Ira Sarkar There should be x++ not i++ Start x = 1 to get output like 1 10 2 9 3 8 4 7 5 6 Program:- #include <stdio.h> int main() { int x, y, num = 10; for (x = 1, y = num; x < y; x++, y--) { printf("%d %d\n", x, y); } }
9th Feb 2021, 6:47 PM
A͢J
A͢J - avatar
+ 3
I Am AJ ! Lothar Oh yes, silly mistake, thank you so much.
9th Feb 2021, 7:12 PM
Ira Sarkar
Ira Sarkar - avatar