Saturday 5 July 2014

C++ program to find greater of two number using inline function


Here is a C++ program to find greater of two number using inline function


 SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
inline int grtr(int x,int y)
{
    return x>y?x:y;
}
int main()
{
    int x,y;
    cout<<"Enter two number : ";
    cin>>x>>y;
    cout<<"Greater of two number : "<<grtr(x,y);
    return 0;
}

Any questions regarding to program please write in comments.

No comments:

Post a Comment