// Finds the largest value of three numbers. // Michael Collard // 9/16/99 #include using namespace std; int main() { // read in the three numbers int n1, n2, n3; cout << "Please enter three numbers: "; cin >> n1 >> n2 >> n3; // find the largest value int largest = n1; // assume the first number is the largest if (n2 > largest) // check if we have a new largest value largest = n2; if (n3 > largest) // check if we have a new largest value largest = n3; // print the largest value out cout << "Largest number of " << n1 << ", " << n2 << " or " << n3 << " is " << largest << '\n'; }