labAssignment5 - Largest = num1, Smallest = num1 /* Next...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 /* Lab assignment 5 Kasey Scott [email protected] CSE 1020.301 L10 this code shows the largest and smallest number given by user */ #include <iostream> int main() { double Largest, Smallest, num1, num2, num3, num4 cout << "Lab Assignment 5\t CSE 1020.301 L10" << endl << "Kasey Scott \t [email protected]" << endl // Promt user to enter num1. cout << "\nPlease enter first number: " cin >> num1 // Promt user to enter num2. cout << "Please enter second number: " cin >> num2 // Promt user to enter num3. cout << "Please enter third number: " cin >> num3 // Promt user to enter num4. cout << "Please enter fourth number: " cin >> num4 // Setting the value of both largest and smallest
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Largest = num1, Smallest = num1 /* Next segment has the if statements that compare numbers to determine largest and smallest value. */ if (Largest < num2) Largest = num2 if (Smallest > num2) Smallest = num2 if (Largest < num3) Largest = num3 if (Smallest > num3) Smallest = num3 if (Largest < num4) Largest = num4 if (Smallest > num4) Smallest = num4 // Show the largest number cout << endl << endl << "The largest value entered was " << Largest << endl Sheet1 Page 2 // Show the smallest number cout << "The smallest value entered was " << Smallest << endl return 0 }...
View Full Document

This note was uploaded on 03/05/2010 for the course DSDDDDDDD dddddfvvc taught by Professor Cxcseef during the Spring '10 term at École Normale Supérieure.

Page1 / 2

labAssignment5 - Largest = num1, Smallest = num1 /* Next...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online