Help, this simple calculator on running shows 'Compilation error'. Can anyone tell me whats wrong with the code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help, this simple calculator on running shows 'Compilation error'. Can anyone tell me whats wrong with the code?

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

14th Jan 2018, 1:55 PM
illusion
illusion - avatar
4 Answers
+ 13
Couple of errors, correct all and tell me if it works: Line 4, you return the value x but you declared the function as void type, change it to int. Line 8, delete the endline at cin, it's cin and not cout. Line 12, you did a spelling mistake with the name of the function. Line 27, syntax error, correct it to 'else if'. Line 35, you can't do the assignment like python, you need to do this: double x = enterNumber(), y = enterNumber();
14th Jan 2018, 2:19 PM
Ran Avital
Ran Avital - avatar
+ 10
https://code.sololearn.com/c9DuVC7Cz163/?ref=app look and ask questions if u dont understand smth😉
14th Jan 2018, 2:05 PM
Botol
Botol - avatar
+ 8
Well done! I liked the code!
14th Jan 2018, 2:44 PM
Ran Avital
Ran Avital - avatar
+ 1
lol the errors xddd tysm coders!
14th Jan 2018, 2:43 PM
illusion
illusion - avatar