how to implement a method smallest which recieves two parameters of double type. it will return the smallest number of them?
Return the smallest of 2 doubles
Collapse
X
-
I assume you already wrote the code. So, what is the problem you are facing? Any errors, warnings, unexpected behaviors?
Regards
Dheeraj JoshiComment
-
Can you write any function?
Can you then alter that to accept 2 doubles are parameters?
Can you then alter that to return a double value?
Can you pick out from the C++ operators which operator will allow you to make the required comparison?
This site does not provide solutions to people who have not made an attempt to write their own solution in the first place. Particularly to such a simple problem as this which quite literally requires a function declaration and a single line of code.
If you can not write a function like this you seriously need to re-read you text books and tutorial material.Comment
Comment