
September 23rd, 2004, 04:06 PM
|
|
Contributing User
|
|
Join Date: Sep 2004
Location: In the Dark City
Posts: 46
Time spent in forums: < 1 sec
Reputation Power: 5
|
|
Quote: | Originally Posted by Etarr18 How would I code a program to find the largest of 3 intergers and then check to see if the sum of the 2 smaller ones is > than the largest? | Like this:
Code:
String num1, num2, num3, num4, num5;///so on...
cout << "Enter a number";
cin >> num1;
cout << "Enter another number ";
cin >> num2;
cout << " Enter another";
cin >> num3;
cout << "and another";
cin >> num4;
cout << " and another";
cin >> num5;
if num1 > num2
if num1 > num4
if num1 > num3
if num1 > num5
cout << num1 ;
if num2 > num1
if num2 > num3
if num2 > num4
if num2 > num5
cout << num2;
///so on so on//
I dont know if this is correct but you can try it. Try the sum part if you need help ask>
|