+ 4

Is this a valid way to declare variables?

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

21st Jan 2021, 5:09 PM
Sagor Mahmud
3 odpowiedzi
+ 3
Your code is fine. But; b may equals zero so you cannot do a division by zero! (Use an if statement here ) The variable div will give you an int so the decimal part is missed(it's your choice here)
21st Jan 2021, 10:50 PM
Hisham YUM 🇲🇦
Hisham YUM 🇲🇦 - avatar
+ 2
Thanks, Hisham YUM 🇲🇦
22nd Jan 2021, 2:39 AM
Sagor Mahmud
+ 1
Welcome 🇧🇩Mohammad Sagor🇧🇩 ! If you got your right answer, do not for forget to mark it as the best one 😉 Have a good day!
22nd Jan 2021, 2:43 AM
Hisham YUM 🇲🇦
Hisham YUM 🇲🇦 - avatar