sorting1 - if((n1>n2)&&(n2<n3))...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 Script started on Thu Feb 21 17:39:33 2008 gorilla% cat sorting1.cpp // Sorts the three first names of three people. #include <iostream> #include <string> using namespace std string n1 string n2 string n3 int main() { cout<<"enter the first name"<<endl cin>> n1 cout<<"enter the second name"<<endl cin>> n2 cout<<"enter the third name"<<endl cin>> n3 cout<<n1<<endl cout<<n2<<endl cout<<n3<<endl
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: if((n1>n2)&&(n2<n3)) cout<<n1<<endl else if((n1<n2)&&(n2<n3)) cout<<n2<<endl else if((n1>n2)&&(n2<n3)) cout<<n3<<endl if((n1>n2)&&(n2>n3)) cout<<n1<<endl else if((n1<n2)&&(n2>n3)) cout<<n2<<endl else if((n1<n2)&&(n2<n3)) cout<<n3<<endl return 0 }gorilla% sorting1 enter the first name joe enter the second name bob enter the third name sll ally Sheet1 Page 2 bob joe gorilla% exit exit script done on Thu Feb 21 17:40:26 2008...
View Full Document

This document was uploaded on 05/01/2011.

Page1 / 2

sorting1 - if((n1>n2)&&(n2<n3))...

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