Either use C++ standard input/output streams or use C standard input/outpur streams. It is a bad idea to mix them.
All standard declarations with very rare exceptions are placed in the standard name space std
So instead of
cin >> n;
you should write
std::cin >> n;
Or place the following directive before using cin
using std::cin;
//,,,
cin >> n;
Also you should include header <cstdio>
where function printf
is declared.
Take into account that this condition
else if(n > 19000)
is invalid because it includes all numbers greater than 10000 including numbers greater than 51000
I would write the program the following way
#include <iostream>
int main()
{
std::cout << "Please enter a #: ";
int block;
std::cin >> n;
if ( n <= 10 )
{
std::cout << "I am <= 10";
}
else if ( n <= 15000 )
{
std::cout << "I am <= 15000";
}
else if ( n <= 19000)
{
std::cout << "I am > 15000 and <= 19000";
}
else if ( n > 19000 && n <= 51000 )
{
std::cout << "I am > 19000";
}
else if ( n > 51000 )
{
std::cout << "I am > 51000";
}
std::cout << std::endl;
}