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 |
Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed?
What are virtual functions?
What is object in oop with example?
Write A Program using Single and Multiple Inheritance.
what type of questions
what is the difference between class and structure in C++?
Explain polymorphism? What r the types of polymorphism? pls give examples?
write a program which best describes polymorphism in real world?
2 Answers CTS, Infosys, NexGen,
c++ program to swap the objects of two different classes
Program to check whether a word starts with a capital letter or not.
What is abstract class in oops?
Out of 4 concepts, which 3 C++ Follow?