firsttest100 - else if c==2 e = a b if e> 10...

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

View Full Document Right Arrow Icon
#include <iostream> using namespace std; void main() { int a,b,c,d,e; cout << " Input the two positive number." << endl ; cin >> a ; cin >> b ; cout << " Choose from 1 and 2." << endl ; cin >> c ; if ( c==1 ) { d = a + b; if ( d > 100 ) cout <<" You have exceeded the maximum limit. " << endl; else if ( d < 100 ) cout <<" You are within or lower than the range." << endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } else if ( c==2 ) { e = a - b; if ( e > 10 ) cout <<" You have a positive answer." << endl; else if ( e < 10 ) cout <<" You have a negative answer. " << endl; } else if ( c > 2 ) cout <<" ERROR." << endl; else if ( c < 1 ) cout <<" ERROR." << endl; }...
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Ask a homework question - tutors are online