firsttest100 - } else if ( c==2 ) { e = a - b; if ( e...

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 &gt; 10 ) cout &lt;&lt;&quot; You have a positive answer.&quot; &lt;&lt; endl; else if ( e &lt; 10 ) cout &lt;&lt;&quot; You have a negative answer. &quot; &lt;&lt; endl; } else if ( c &gt; 2 ) cout &lt;&lt;&quot; ERROR.&quot; &lt;&lt; endl; else if ( c &lt; 1 ) cout &lt;&lt;&quot; ERROR.&quot; &lt;&lt; endl; }...
View Full Document

Ask a homework question - tutors are online