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 difference between multiple inheritance and multilevel inheritance?
What is object-oriented programming? Webopedia definition
What is meant by multiple inheritance?
What is encapsulation with example?
What is object in oop with example?
• What are the desirable attributes for memory managment?
Get me a number puzzle game-program
What is new keyword in oops?
Can main method override?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
program for insertion ,deletion,sorting in double link list
what is graphics
What is oops with example?
How long to learn object oriented programming?
What is encapsulation in oop?