/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* *GreatestNum.cpp *This program will display the highest integer from the three numbers entered by the user. *@MDPN *@09072010 */ #include <iostream> using namespace std; int main() { int int1, int2, int3; cout<<"\t\t\t Highest Number"<<endl <<"\t\t\t --------------"<<endl<<endl; cout<<"This program will display the highest integer entered by the user." <<endl<<endl<<endl; cout<<"Please input 1st integer = "; cin>>int1; cout<<"Please input 2nd integer = "; cin>>int2; cout<<"Please input 3rd integer = "; cin>>int3; cout<<"\n\nThe highest number is "; if(int1>int2 && int1>int3) { cout<<int1; }//end if else if(int2>int3 && int2>int1) { cout<<int2; }//end else-if else { cout<<int3; }//end else cout<<"."<<endl<<endl; return 0; }//end main