In for loop "for(i=124;i<124;i++)" what is the result we get? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

In for loop "for(i=124;i<124;i++)" what is the result we get?

1st Nov 2019, 3:59 AM
Bikash Patel
Bikash Patel - avatar
5 Answers
+ 6
i is 124, 124 cant be less than 124. the for loop wont execute.
1st Nov 2019, 4:05 AM
꧁༺ Jenspi ༻꧂
꧁༺ Jenspi ༻꧂ - avatar
+ 6
hey bikash as your code for(int i=124;i<124;i++) 124 is not less then 124 that is why in the first iteration the condition become false so your body will not execute . also you don't get any compile time error that's it
1st Nov 2019, 4:32 AM
Saroj Patel
Saroj Patel - avatar
+ 1
Unless you have a declaration for variable <i> before that for loop, you will get error as variable <i> is unknown.
1st Nov 2019, 9:06 AM
Ipang
+ 1
First up all i is not less than or greater than 124 so it doesn't Matter i <124 it is similar to i=124 As we use thise in minimum number programe in arry a [0]>a [i] So it is equal to i=124.. so you will get no output..
3rd Nov 2019, 12:55 AM
Bhushan Shinde
Bhushan Shinde - avatar
0
NOTHING. You just asked someone to write number 124 to 124 excluding 124. i.e. (after 124 to before 124.) https://code.sololearn.com/c8ZlZgV6oQo5/?ref=app
2nd Nov 2019, 8:55 PM
Walid Al Hasan
Walid Al Hasan - avatar