lab2 - percent1=(c/a)*100; percent2=(d/b)*100; if...

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

View Full Document Right Arrow Icon
#include <string> #include <iostream> using namespace std; u double a=1, b=1, c=1, d=1; double temp; double percent1, percent2; int scale; int main() { cin >> a >> b >> c >> d; scale=0; temp=0; if (a<b) { temp=a; a=b; b=temp;} if (c<d) { temp=c; c=d; d=temp;}
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: percent1=(c/a)*100; percent2=(d/b)*100; if (percent1&gt; percent2) { scale=int(percent2);} else scale=int(percent1); if (scale&lt;1) { scale=1;} if (scale&gt;100) { scale=100;} cout &lt;&lt; percent1 &lt;&lt; percent2&lt;&lt; endl; cout &lt;&lt; scale &lt;&lt; &quot;%&quot; &lt;&lt; endl; cin &gt;&gt; a &gt;&gt; b &gt;&gt; c &gt;&gt; d; } }...
View Full Document

Ask a homework question - tutors are online