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
Why we use classes in oop?
What does it mean when someone says I oop?
What is overloading in oop?
What is a class and object?
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.
What is oops?what is its use in software engineering?
What is property in oops?
What is encapsulation with example?
any one please tell me the purpose of operator overloading
write string class as your own class in java without using any built-in function
What is for loop and its syntax?
How to use CMutex, CSemaphore in VC++ MFC
Is enum a class?
class type to basic type conversion
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)