Home > Back-end >  So why do I and I are output the same results?
So why do I and I are output the same results?

Time:06-03

#include

Int main ()
{
Int I, s=0;
for(i=1; ; + + I)
{
S=s + I;
If (s> 10) break;
Printf (" s=% d \ n ", s);
}
return 0;
}

CodePudding user response:

For i++ and + + I are here on the

For a=i++; And a=+ + j; A different
But for I, expression, after all is the gained a

So for your code no difference

CodePudding user response:

Are in + 1 why do you think I will have different results?

CodePudding user response:

i=0;
I++ and + + I difference:
I++=0; I value into 1
+ + I=1; I value to 1

CodePudding user response:

+ + I add after first use
I++ use after first add
If is take out alone do since, no difference

CodePudding user response:

CodePudding user response:

The
reference fireyou reply: 3/f
I=0;
I++ and + + I difference:
I++=0; I value into 1
+ + I=1; I value into 1

Thank you, I can understand what you say

CodePudding user response:

reference 5 floor MianHou reply:

There are a lot of knowledge need to know really is!

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related