current position:Home>C language reading program, why 5? Seek explanation

C language reading program, why 5? Seek explanation

2022-02-02 21:14:19 CSDN Q & A

img




Refer to the answer 1:

m++ Execute after judgment
m = 4 when
4 ++ < 4 For false
4++ Turned into 5




Refer to the answer 2:



Refer to the answer 3:
//m++ It's output first , add 1, therefore while The loop can take the form of while(m<4){    m=m+1;    s=s+m;}m=m+1;// It's clear that in the end m=5



Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202022114176319.html

Random recommended