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
What are the components of marker interface?
What is encapsulation in ict?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
Why do we use class?
What is polymorphism in oop example?
What are oops functions?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is the importance of oop?
Which type does string inherit from?
What is polymorphism oop?
Why is oop better than procedural?
what type of question are asked in thoughtworks pair programming round ?
can we make game by using c
Why do we use oop?
What is difference between inheritance and polymorphism?