write a c++ program to find maximum of two numbers using
inline functions.
Answer Posted / manjunathtek
#include<iostream>
using namespace std;
int main()
{
int c;
c=max(5,4); //will display 5
cout<<c<<endl;
return 0;
}
inline int max(int a, int b)
{
return (a>b)? a:b;
}
| Is This Answer Correct ? | 140 Yes | 52 No |
Post New Answer View All Answers
What is inheritance in oop?
What is encapsulation with real life example?
What is polymorphism what is it for and how is it used?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What is overriding in oop?
Why do we use inheritance?
Why multiple inheritance is not allowed?
What is oops in simple words?
Which is better struts or spring?
What is oops and its features?
Why polymorphism is used in oops?
What are the three parts of a simple empty class?
How is class defined?
Why multiple inheritance is not possible?
What does sksksk mean in text slang?