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 the problem with multiple inheritance?
what is different between oops and c++
What are properties in oop?
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
how to get the oracle certification? send me the answer
How to improve object oriented design skills?
What is encapsulation c#?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Get me a number puzzle game-program
How do you use inheritance in unity?
What is debug class?what is trace class? What differences are between them? With examples.
What is difference between #define and const?