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

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> percent2) { scale=int(percent2);} else scale=int(percent1); if (scale<1) { scale=1;} if (scale>100) { scale=100;} cout << percent1 << percent2<< endl; cout << scale << "%" << endl; cin >> a >> b >> c >> d; } }...
View Full Document

This note was uploaded on 05/03/2011 for the course CSCI 180 taught by Professor Goldwasser,m during the Fall '08 term at Saint Louis.

Ask a homework question - tutors are online