program in c++ that can either 2 integers or 2 floating
point numbers and output the smallest number
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 |
What is polymorphism and example?
Advantage and disadvantage of routing in telecom sector
design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }
Get me an image implementation program.
What is the types of inheritance?
How to call a non virtual function in the derived class by using base class pointer
What is inheritance and how many types of inheritance?
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.
any one please tell me the purpose of operator overloading
What is abstraction?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What is object in oop with example?