|
From: Jay B. <jay...@ni...> - 2004-04-26 17:01:43
|
[snip]
#include <iostream>
using namespace std;
int main()
{ // EXAMPLE 3.8 USING COMPOUND CONDITIONS
// Uses the compound conditions to find the minimum of three integers
int n1,n2,n3;
cout << "Enter three integers: ";
cin >> n1 >> n2 >> n3;
if (n1 <=3D n2 && n1 <=3D n3) cout << "Their minimum is " << n1 << =
endl;
if (n2 <=3D n1 && n2 <=3D n3) cout << "Their minimum is " << n2 << =
endl;
if (n3 <=3D n1 && n3 <=3D n2) cout << "Their minimum is " << n3 << =
endl;
cin.get();
return 0;
}
[/snip]
Add this line before return 0;
system("PAUSE");=09
So....
#include <iostream>
using namespace std;
int main()
{ // EXAMPLE 3.8 USING COMPOUND CONDITIONS
// Uses the compound conditions to find the minimum of three integers
int n1,n2,n3;
cout << "Enter three integers: ";
cin >> n1 >> n2 >> n3;
if (n1 <=3D n2 && n1 <=3D n3) cout << "Their minimum is " << n1 << =
endl;
if (n2 <=3D n1 && n2 <=3D n3) cout << "Their minimum is " << n2 << =
endl;
if (n3 <=3D n1 && n3 <=3D n2) cout << "Their minimum is " << n3 << =
endl;
cin.get();
system("PAUSE");=09
return 0;
}
|