welcome aboard....please post what you've got so that w can guide you. Here is some pointers:
1. start with your headers, you'll need to figure out which ones you'll need:
2. You need:
using namespace std;
3. you need to declare some variables:
4. Ask the user to input a number:
cout << "Enter an integer: ";
5.Allow the user to input:
cin >> num;
6. For the actual calculation, we use the modulos (%) operator. From basic math/algebra, you ought to know theoretically, how to calculate even and odd numbers....do they have remainders....if they do...what's the remainder.
The above test to see if the number is odd or not...if it is, do something...if it's not....do something.
8. Then you'll need output statements (answers to provide) to you professor:
cout << num << " is an odd number" << endl;
In the future....search the internet(GOOGLE)...or the frum to see if the problem has been covered already.
10. most importantly...to be successful in c++ you'll simply have to do the work....and practice...
Hope this helps...have a good day!
If a number is divisible by 2, it's even. If it's not divisible by 2, it's odd. You can find out if a number is divisible by 2 by finding the remainder of division by 2. C++ has a remainder operator, %. So it stands to reason that if you have a number x, you can say:
#define A 3// name a constant
long int booking_ID ; ...