Assignment 10 - CSC 124 10-12-07 4.1 #include...

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

View Full Document Right Arrow Icon
CSC 124 10-12-07 4.1 #include <iostream> using namespace std; int main () { float x; cout << "Please enter a number: " << endl; cin >> x; if (x > 0) cout << "This number is positive." << endl; else if (x < 0) cout << "This number is negative." << endl; else cout << "This number is zero." << endl; system ("PAUSE"); return 0; } 4.2 #include <iostream> using namespace std; int main () { float a, b, c; cout << "Please enter three numbers. Press enter after each." << endl; cin >> a >> b >> c; { if (a < b < c) cout << a << b << c << endl; else if (a < c < b) cout << a << c << b << endl; else if (b < a < c) cout << b << a << c << endl; else if (b < c < a) cout << b << c << a << endl; else if (c < a < b) cout << c << a << b << endl; else if (c < b < a) cout << c << b << a << endl; } system ("PAUSE");
Background image of page 1

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

View Full DocumentRight Arrow Icon
return 0; } 4.3 #include <iostream> using namespace std; int main () { int x; cout << "Please enter an integer between 0 and 35: " << endl; cin >> x; if (x <= 9) cout << "\n Your number is: " << x << endl;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/21/2008 for the course CSC 124 taught by Professor Salim during the Fall '07 term at California University of Pennsylvania.

Page1 / 4

Assignment 10 - CSC 124 10-12-07 4.1 #include...

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

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