Hello, I need help guys. My instructor want one exam from me.
I need to do program which will:
Count only odd numbers from interval <a,b>
Border of interval will be specified from keyboard and then program print count of loaded values and sum these values.
Well, it's kinda complicated for me. This is new curriculum what I am trying to learn, actually.
I did something, but it won't compile. Am I am on a good way? And what is bad? Thanks for your help!
Well, even if you don't understand the meaning of the error message, at least the compiler should tell you at which line and column it found an error. Use that as your starting point.
In this case it is the cin >> fNumb >> endl; Use endl only for output - example cout << endl;. Hence you need just cin >> fNumb; without the endl which the compiler doesn't know what to do with.
As a matter of good practice, you should avoid the use of global variables. In this case
1 2
int fNumb;
int sNumb;
- move those declarations inside the main() function.