0
What's wrong with my logic?
https://www.sololearn.com/coach/23?ref=app It's showing 5th test case failed. Code is given below👇 https://code.sololearn.com/cfnIgVc6n5AM/?ref=app
5 Respostas
+ 3
Samia Tisha
At line 11 dollar variable will overflow when the input is too big. Try using long type.
https://en.m.wikipedia.org/wiki/Integer_overflow
else { return 0; } //You should remove this, it's unnecessary and will make the last line of the function body to be unreachable
else if(peso<dollar){
printf ("Pesos\n");
}
That's redundant and could have been written as:
else {
printf("Pesos\n")
}
+ 2
Try remove the else and change the if else to else.
If prices are same you code will bug cause will be none of them.
+ 1
i get it somehow hard to understand your quiz because i see all it is okay
+ 1
Not wrong, but tip to be "faster".
You can multiple pesos by 0.02 and them don't need multiply dollar by 100.
Can work with decimals too.
edited: that's the problem. I changed and works.
+ 1
Kevin ★
Now I understand the problem. Thank you😊