0
Explain the code
When it comes to 3 it terminate .But the output is 2
6 Respuestas
+ 1
Ajith are you sure that this is the exact code? Because the output is coming out to be 54 just like it should.
0
int cnt=5;
while(cnt>=0){
if(cnt==3)
break;
printf("%d \n",cnt);
cnt--;
}
Output is 2
0
The output should be 54. And 2 numbers are printed.
0
Damn sure
0
Run the code again, the output is 54.
First iteration:
cnt = 5
So 5 is printed
Second iteration:
cnt = 4
So 4 is printed without line break.
Third iteration:
cnt = 3
The loop breaks
0
Okie I got thank you much