This deals with bools
Create a program that asks the user for their age. The program then outputs 1 if the age is 21+ (and outputs 0 if its under 21).
So, for example if the user enters 14, the program would output 0.
If the user entered 45, the program would output 1.
Why don't you start by writing pseudo code? Try to convert that into C/C++ and if you run into any problems we'll help. Use the code tags to post your code.
I haven't learned if or then while.....we can't use that. I'm just starting basic bools.
A boolean type has a true/false (yes or no) value. It serves no purpose at all until that value is tested. You would test the value in statements such as if, or while etc.
Without such tests, what you have is the equivalent of "the sound of one hand clapping", you can meditate upon it, but it won't be a program.
hey pav500 i think you are in my class and our professor strictly taught us this. maybe you weren't paying attention in class. that's not nice. it's in our lecture notes, schaum's outline, and his powerpoint slides which you can print out. has all the info there. i know that you are in my class because our professor is unique and he creates his own questions, so you have to be in our class to be with this unique question.