0

Please check why I am not getting answer

https://code.sololearn.com/c7KXIldVuamb/?ref=app

15th Mar 2021, 4:34 PM
Vikash Kumar Tiwari
Vikash Kumar Tiwari - avatar
2 Réponses
+ 1
The compiler is not able to detect that `result` will be assigned a value. It thinks that there is a possibility that `result` will be uninitialized when you use it on line 43. To make it work, simply give `result` a default value like 0. int result = 0;
15th Mar 2021, 4:41 PM
XXX
XXX - avatar
+ 3
Hello Vikash Kumar Tiwari It helps to read the error messages, because they give you a hint what went wrong. Your variables are not initialized. Means just give them a value: int x , y , result = 0;
15th Mar 2021, 4:51 PM
Denise Roßberg
Denise Roßberg - avatar