Sunday, November 18, 2012

Show which numbers is greater amongst 3 in C++

#include <conio.h>
#include <iostream.h>
int main()
{
        int a,b,c;
        cout<<"enter a value of a";
        cin>>a;
         cout<<"enter a value of b";
        cin>>b;
         cout<<"enter a value of c";
        cin>>c;
        if (a>b && a>c)
        cout<<"The value A is Greater than all 2";
        else if (b>c)
        cout<<"The value B is Greater than all 2";
        else
        cout<<"The value C is Greater than all 2";
getch();
return 0;
}

No comments:

Post a Comment