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 the problem with multiple inheritance?

0 Answers  


what is different between oops and c++

0 Answers   IIT,


What are properties in oop?

0 Answers  


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

0 Answers  


how to get the oracle certification? send me the answer

0 Answers   Oracle,






How to improve object oriented design skills?

0 Answers  


What is encapsulation c#?

0 Answers  


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

0 Answers   UBS,


Get me a number puzzle game-program

0 Answers  


How do you use inheritance in unity?

0 Answers  


What is debug class?what is trace class? What differences are between them? With examples.

0 Answers  


What is difference between #define and const?

3 Answers   emc2,


Categories