已知int k,x;则语句for(k=0,x=0;k

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 04:18:46
已知intk,x;则语句for(k=0,x=0;k已知intk,x;则语句for(k=0,x=0;k已知intk,x;则语句for(k=0,x=0;kstep1:k==0,x==0=>x==2step

已知int k,x;则语句for(k=0,x=0;k
已知int k,x;则语句for(k=0,x=0;k

已知int k,x;则语句for(k=0,x=0;k
step 1:k == 0,x == 0 => x == 2
step 2:k == 1,x == 2 => x == 4
step 3:k == 2,x == 4 => x == 6
step 4:k == 3,x == 6 => x == 8
step 5:k == 4,x == 8 => x == 10
step 6:k == 5,x == 10 => end
结果 k == 5
附上代码:
#include
void main()
{
\x05int k,x;
\x05for(k=0,x=0;k

x=2,k=0,
x=4,k=1,
x=6,k=2,
x=8,k=3,
x=10(终止循环),k=4.