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 is encapsulation in ict?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is oops with example?
How is class defined?
What are the 5 oop principles?
What is the purpose of polymorphism?
What is multilevel inheritance?
What is multilevel inheritance in oop?
What is difference between abstraction and encapsulation?
What are the types of abstraction?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is the types of inheritance?
What is an advantage of polymorphism?
Whats oop mean?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)