Why does this code throw errors at me? (Fixed) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why does this code throw errors at me? (Fixed)

So Iā€™ve been doing code coach and the errors are happening on the question ā€žthatā€™s odd...ā€œ the code really doesnā€™t seem to like line 17 wich is odd since there shouldnā€™t be any error. Hope you guys can tell me whatā€™s wrong with this :) Code: https://code.sololearn.com/cCfG6AOMwg69/?ref=app Edit: I could fix line 17 but line 21 and 27 show an error now :/

18th Aug 2020, 8:56 AM
nanew
nanew - avatar
3 Respostas
+ 1
`=` and `==` are different operators. = assigns value to left hand operand. == compares operands for equality. on line 17 use = for assignment int i = 0;
18th Aug 2020, 8:59 AM
šŸ‡®šŸ‡³OmkaršŸ•‰
šŸ‡®šŸ‡³OmkaršŸ•‰ - avatar
0
Md. Nasif-ur-Rahman Rimon the error on 21 is fixed now but 27 is still there, the error says im using unassigned variable ā€˜sumā€™
18th Aug 2020, 9:05 AM
nanew
nanew - avatar
0
Md. Nasif-ur-Rahman Rimon thanks for your help its fixed now :P
18th Aug 2020, 9:11 AM
nanew
nanew - avatar