+ 1
Compare three numbers and treat if they’re equal
Hey guys please help me to write a C program that reads three numbers typed on the keyboard, then it displays their minimum. And treat the case where the three numbers are equal. The code I tried is below and the problem is when they’re equal it should only say so without telling me the min . Please helpppp https://code.sololearn.com/cr48jqTKQO1A/?ref=app
2 odpowiedzi
+ 1
Here's a simple fix:
https://code.sololearn.com/cZ4VI7so53KH
0
First note that in if-else block :
If the 'if condition is then it executes it's block of code. Don't check else.
Only when condition is false then it goes to else part.
example: in your code, if I enter 5 5 5 then
by if part 5<=5 is true then it sets min=B;
no else part executed so no outputs also..