Here why we use = sign, single + why not? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Here why we use = sign, single + why not?

int sum_up (int x, int y) { x += y; return(x);

18th Feb 2022, 4:43 PM
BABLU TAUNWAL
BABLU TAUNWAL - avatar
1 Réponse
0
BABLU TAUNWAL x += y means x = x + y If you use single + then it would be (x + y) which might be wrong because you have to assign (x + y) to another variable so (x += y) make sense because (x = x + y)
18th Feb 2022, 4:54 PM
A͢J
A͢J - avatar