| | |
Loop help and such.
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
1
#12 23 Days Ago
You're going to return from main in one of two places:
Right?
int main ()
{
int number;
int counter = 0;
int flags = 1;
bool flag_none = true;
bool fag_yes = false;
cout << "Enter a number, hit enter to confirm, and repeat to test flags: " << endl;
cout << endl;
while (counter < 7)
{
cin >> number;
cout << "Echoing number, you entered " << number << endl;
if (number >= 10 && number <= 500)
{
return true;
}
else
{
return false;
}
counter ++;
}
if (counter < 7 == true)
{
cout << "Number " << counter << " is between 10 and 500" << endl;
cout << "Number " << counter << " is not flagged. " << endl;
}
else (counter < 7 == false);
{
cout << "Number " << counter << " is either less than 10 or more than 500" << endl;
cout << "Number " << counter << " is flagged." << endl;
cout << "There have been " << (flags ++) << " flags";
}
} "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Other Threads in the C++ Forum
- Previous Thread: i want to know......
- Next Thread: sort code & write exchange increment line
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets






