0
[solved]Can't Understand the question
Please explain how this is working https://www.sololearn.com/post/464916/?ref=app When I tried to Run it : https://code.sololearn.com/c35u4X3C83NZ/?ref=app It shows an error.
9 Answers
+ 6
a = 0 , b = 0 , c = 0
on every loop a and b will increment by 1
after 7 loop runs now a = 7 b = 7 and c = 0 so the condition a < 7 is false
now after 7 more runs a = 14 b = 14 and c = 0 so now b < 14 is false
but even after infinite runs the value of c will always remain 0 which will return c < 4 as True and will cause the loop to run forever
+ 4
Please Elaborate your question.what you wanna ask?
+ 4
that's called comma operator, only the last statement will be executed which is c<4, so until c<4 that's when the execution will stop and in the loop "c" is not incremented that make the loop an infinite loop
+ 4
Akshay Panwar do you read the warning, it's just trying to tell you that the left hand operands have no effect on how the loop works, which I have stated earlier, it seem the code won't run on sololearn because the compiler have been configure not to run if there is a warning
+ 3
you didn't use int main(){
}
0
Rimjhim š§ļø I was copying the link that time .
Sorry for that.
Now explain me.
0
But ā³AsterisKā³ Rimjhim š§ļø
Can you explain why my code is giving an error to me
0
ā³AsterisKā³ is have used it but still showing an error
0
Thank you both