Declaring

I am pretty darn new at this, the code i'm writing is giving me two errors and two lines. the errors are on lines 9 and 12. errors state "10:14: error: 'number' was not declared in this scope
13:54: error: 'endline' was not declared in this scope.

any help is greatly appreciated.

1.#include <iostream>
2.using namespace std;
3.int main()
4.{
5. int num;
6. cout << "Enter an integer: ",
7. cin >> num;
8. cout << endl;
9. if (0 <= number <= 10)
10. cout << num << " is within 0 and 10." << endl;
11. else
12. cout << num << " is not within 0 and 10." << endline;
13. return 0;
14.}
In line five you name it as num, not as number. It has to have the same name. Also you can't use endline, you need to use endl.

Hope that made sense!
yeeeess, that makes sense, I was more or less piecing this together from examples in a book, didnt even register the differences, thanks a ton!
Topic archived. No new replies allowed.