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

Which method cannot be overridden?

0 Answers  


What is a linked list?

7 Answers   IBM, Neural Info,


What is command routing in MFC

1 Answers   GE,


What is object-oriented programming? Webopedia definition

0 Answers  


what is multi level inheritance give n example ?

13 Answers   HDFC, Hulas Steel, Ness Technologies,






what is use to destroy an object? illustrate.

5 Answers   TCS,


Explain the concept of abstracion and encapsulation with one example. What is the difference between them?

3 Answers   PCS,


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,


What is interface in oop?

0 Answers  


what is difference between objects and function

1 Answers  


Why u change company?

12 Answers   BOB Technologies,


Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed?

4 Answers   EA Electronic Arts,


Categories