Incremento decremento | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Incremento decremento

Alguien me puede explicar el incremento y el decremento

12th Apr 2020, 4:05 AM
Carlos Pérez Adán
Carlos Pérez Adán - avatar
11 Answers
0
Yeah!! It assign 10 to y and gets modified itself after as 11... I couldn't send the screenshot, otherwise I will
12th Apr 2020, 1:28 PM
sarada lakshmi
sarada lakshmi - avatar
+ 1
Hay Carlos Miguel Perez Adan just use English here as everyone understands same . We respect all languages but it is not possible for us to learn all . So please use English language
12th Apr 2020, 4:09 AM
Ayush Kumar
Ayush Kumar - avatar
0
could someone help me understand the increase and decrease
12th Apr 2020, 4:16 AM
Carlos Pérez Adán
Carlos Pérez Adán - avatar
0
Hii, carlos Pérez Adán... Si entiendes inglés, puedo ayudarte... porque no sé español
12th Apr 2020, 7:23 AM
sarada lakshmi
sarada lakshmi - avatar
0
sarada lakshmi I would like you to help me understand the ++ y --
12th Apr 2020, 7:33 AM
Carlos Pérez Adán
Carlos Pérez Adán - avatar
0
Yeah!! Increment and decrement are two types 1.pre increment 2.post increment In pre increment, incrementation done first and the other operations done next.. And the post increment is vice versa.. For ex, x=10 y=++x //11 z=x++ //10 Here,why the y value is 11 means, first the x gets incremented and then assignment is done... And why the z value 10 means, first the assigning done first and the incrementation done next... But,In both the cases, the value of x gets changed to 11.. Coming to decrement operators.. It's also two types 1. Pre decrement 2. Post decrement These two also works same as above.. But, the value gets decreased in this case.. For ex, x=10 y=--x //9 z=x-- //10 But,in both the cases the value of x gets decreased..
12th Apr 2020, 7:41 AM
sarada lakshmi
sarada lakshmi - avatar
0
Hope it'll help you 👍 Otherwise, feel free to ask me anything...
12th Apr 2020, 7:43 AM
sarada lakshmi
sarada lakshmi - avatar
0
example: x = 10; y = x ++; results: x = 10 y = 10 x = 11
12th Apr 2020, 8:02 AM
Carlos Pérez Adán
Carlos Pérez Adán - avatar
0
No, y results in 10..coz,its post increment know.. So, other operations are done first and incrementation done next... So, first value of x is assigned to y and then internally incrementation was done
12th Apr 2020, 8:03 AM
sarada lakshmi
sarada lakshmi - avatar
0
you mean that and have a value of 10 until it goes to the next line there it will be 11 when is y = x ++;
12th Apr 2020, 8:13 AM
Carlos Pérez Adán
Carlos Pérez Adán - avatar
0
your question given here is interesting. ill cant help you. p.s. I cant understand the question. Please use Google Translate.
21st Apr 2020, 7:11 AM
DJK
DJK - avatar