can be processed...having trouble nesting within statements.
#include <iostream>
using namespace std;
int main()
{
//variable declarations
int a = 0;
int b = 0;
int set_no = 0;
//prompt user for integers
cout << "\nEnter Set number ==>";
cin >> set_no;
cout << "Please enter value for Integer A and press the Enter key ;";
cin >> a;
cout << "Please enter value for Integer B and press the Enter key ;";
cin >> b;
while (!(set_no == -999))
{
//decide whether Integer A is larger than Integer B
if (a > B)/>
{ cout << "Integer A ";
cout <<a;
cout <<" is larger than Integer B ";
cout <<b;
cout <<"\n";
}
else
{ cout << "Integer A ";
cout <<a;
cout <<" is not larger than Integer B ";
cout <<b;
cout <<"\n";
}//end if
cout << "\nEnter Set number ==>";
cin >> set_no;
cout << "Please enter value for Integer A and press the Enter key ;";
cin >> a;
cout << "Please enter value for Integer B and press the Enter key ;";
cin >> b;
}//end while
cout << "\n End of Program\n";
//Add lines for Visual Studio 2010
int xx;
cout << "\nPress any key to continue, then hit the Enter key!";
cin >> xx;
return 0;
}//end of program
This post has been edited by Salem_c: 30 October 2011 - 10:30 AM
Reason for edit:: move prose outside the code tags

New Topic/Question
Reply


MultiQuote



|