program in c++ that can either 2 integers or 2 floating
point numbers and output the smallest number



program in c++ that can either 2 integers or 2 floating point numbers and output the smallest numbe..

Answer / 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

More OOPS Interview Questions

What is polymorphism and example?

1 Answers  


Advantage and disadvantage of routing in telecom sector

1 Answers  


design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }

0 Answers  


Get me an image implementation program.

1 Answers  


What is the types of inheritance?

1 Answers  


How to call a non virtual function in the derived class by using base class pointer

4 Answers   HCL,


What is inheritance and how many types of inheritance?

1 Answers  


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1 Answers  


any one please tell me the purpose of operator overloading

1 Answers   Amazon,


What is abstraction?

9 Answers  


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

2 Answers  


What is object in oop with example?

1 Answers  


Categories