program in c++ that can either 2 integers or 2 floating
point numbers and output the smallest number
Answer Posted / makichut
#include <iostream>
using namespace std;
int smallest(int a, int b){
return (a<b) ? a:b;
}
float smallest(float a, float b){
return (a<b) ? a: b;
}
int main(){
cout<<smallest(10,20)<<endl;
cout<<samllest(10.2,20.2)<<endl;
return 0;
}
| Is This Answer Correct ? | 37 Yes | 16 No |
Post New Answer View All Answers
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
What is static in oop?
What is oops and its features?
Why multiple inheritance is not possible?
What is a null tree?
How do you achieve polymorphism?
What is the full form of oops?
Can an interface inherit a class?
Can destructor be overloaded?
What is constructor overloading in oop?
Why is abstraction used?
What is the important feature of inheritance?
Why do we use class?
Which is better struts or spring?