C++ Program for Largest Among Two Numbers

In this program, you'll learn to print largest among two numbers.



Source Code
#include<iostream>
using namespace std;

int main()
{
    int a, b;
    cout<<"Enter value of two variables: ";
    cin>> a >> b;

    if(a > b)
    {
        cout<<"a is greater";
    }
    else
    {
        cout<<"b is greater";
    }
    return 0;
}
Output
Enter value of two variables: 75 89
b is greater