0

Problem with saving inputs properly!

Hey brothers and sisters.. I have a problem here with my code but I canā€™t find it. If anyone could help me, I will appreciate it very much. The codeā€™s idea is to convert between units as the user want, but the problem Iā€™m facing is whatever the number the user puts, it get saved as whole another and kinda weird number that is not even close to the userā€™s number. I couldnā€™t figure out the issue, so Iā€™m looking for your help thankfully šŸ™šŸ». https://code.sololearn.com/cEt0kgZi985a/?ref=app

27th Jan 2023, 2:03 AM
Murtaja Ali
3 Answers
+ 3
ļ»æMurtaja Ali The error is not how the number entered is being saved. See attached example. It shows the entered num is being correctly interpreted and put into memory. The error is that for some reason you are attempting to use case 1 as the method of getting the number which has no logic. The code is rather confusing. And I don't understand the while loop, maybe I'm missing something in your intent. You have 4 void functions, you only need 4 cases. You also need to modify the main code to pass the input number variable to the functions as a parameter when calling them, as well as modifying the functions to accept that parameter. See lesson 37.1 https://code.sololearn.com/cC9ap0sk5Pf2/?ref=app
27th Jan 2023, 3:45 AM
Scott D
Scott D - avatar
27th Jan 2023, 3:56 AM
Scott D
Scott D - avatar