Lee_assig6 - if (num3 > num4) swap (num3, num4) if (num1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 //Cheu Lee #include <iostream> using namespace std int main () { double num1, num2, num3,num4 cout<<"Enter a number: " cin>>num1 cout<<"Enter a number: " cin>>num2 cout<<"Enter a number: " cin>>num3 cout<<"Enter a number: " cin>>num4 if (num1 > num2) swap (num1, num2) if (num2 > num3) swap (num2, num3)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if (num3 > num4) swap (num3, num4) if (num1 > num2) swap (num1, num2) if (num2 > num3) swap (num2, num3) cout<<"The numbers are: "<<num1<<" "<<num2<<" "<<num3<<" "<<num4<<"\n" return 0 } //main void swap (double &n1, double &n2) { double temp temp=n1 n1=n2 n2=temp }...
View Full Document

This note was uploaded on 05/16/2010 for the course CISCO EST61 taught by Professor Miller during the Spring '10 term at Fresno City College.

Ask a homework question - tutors are online