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 |
Can you explain polymorphism?
What is encapsulation with example?
Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.
what is a virtual class?
5 Answers Cap Gemini, IBM, Infosys, Trinity Technologies,
Write an operator overloading program to Overload ‘>’ operator so as to find greater among two instances of the class.
Can an interface inherit a class?
Is data hiding and abstraction same?
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
What is overloading in oop?