New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Please TELL ME THAT WHAT IS ++ SIGN FOR IN 5++ AND ++5 or. In 5-- and--5
Please tell me I am not understanding
14 Answers
+ 11
This is a very good question.
There is no difference if they are used by themselves.
Take this:
int x = ++5;
The output of this code is 6. It says that x is equal to 1 more than 5.
What about this:
int x = 5++;
The value of x is still 5. Why? This says to set the variable x to 5, and then increment the value. So x ends up as 5.
Hope this helps! •_•
+ 8
Yeah, It can be hard when you're new. I struggled with this a lot when I was new.
+ 7
5 += ++6
5 += 7
5 = 5 + 7
12
+ 7
@Mukul You're Welcome!
+ 5
++ means you add 1 to the value in front/behind of it, -- does the opposite.
Example:
int x = 5;
x--; //x Will become 4
x++; //x will become 5 again
+ 5
Okay, here is an example for your next question:
int x = 5;
x += 5; //x Will become 10. Why? x += 5 actually means x = x + 5 --> x = 5 + 5 = 10. It's some sort of 'shortcut'.
+ 4
This is most asked question on this site. Just use 'search' function provided here
+ 1
thanks a lot friends
+ 1
I am new to this
+ 1
5+=6++ means
5+=6
5=5+6
11
+ 1
nice doubt....
these questions are comes from increment and decrement...
++5 means first increase by 1 then answers is 6.
--5 first decrease by 1 then answers is 4.
0
please also tell me that wat is this for 5+=6++
0
can any one please help me with this problem?i have studied all the concepts in c and c++, almost all the concepts but when a program,slightly difficult program is asked i dont know how to implement this concepts and where to implement it? please give me a solution.
0
this is post and pre increment operation