Nov 22, 2017 Awais Liaqat

C++ Program To Find Greatest Number Between Three Numbers
5   6   51   Programming - C++

Facebook   Twitter   Google   Email


This program shows the greatest number between three numbers using if-else-if statement. It takes three numbers as input from user and output the greatest number.

Source Code:

using namespace std;
int main()
    int n1, n2, n3;
    cout<<"Enter First Number: ";

    cout<<"Enter Second Number: ";

    cout<<"Enter Third Number: ";
    if(n1 > n2 && n1 > n3)
        cout<<"First number is greatest "<<endl<<"which is: "<<n1;
    else if(n2 > n1 && n2 > n3)
        cout<<"Second number is greatest "<<endl<<"which is: "<<n2;
        cout<<"Third number is greatest "<<endl<<"which is: "<<n3;
    return 0;

Is this helpful?   Yes   No

Facebook   Twitter   Google   Email
Click to copy
Successfully copy the link to share

Leave a Comment

Comments (6)

Thank you for your feedback
You are now following
Request Sent! Wait for Approval
Removed From Following
Something wents wrong!
Thank you for your comment