+ 1
Plz help to find the error
#include <stdio.h> int main() { int i; for(i=1;i>11;++i) { printf("%d",i); } return 0; }
7 Answers
+ 7
*It'll be i < 11. *
(not i >11, as the loop is false here.)
+ 4
Chittaranjan behera you won't get output.
Because your condition in For loop is already false so it won't satisfies the condition
Which results in no output.
See this below code.
I hope this will help you:)
https://code.sololearn.com/cL85YCEU58M1/?ref=app
+ 4
Just quick tips on how to manage and fix problems like this -
1) Doing DRY CODE with pencil and paper really help to fix or find the bug or typo.
2) Putting a print statement inside the for loop to see whether the loop's condition is working properly is another way to find the error.
+ 2
Thanks a lot š
+ 1
Thank you
0
Its need to be i < 11