I'm not sure I understand what you want, but here's a guess. If
NOINPUT
is defined, the following will execute the
if
statement, with
num
taking on the values 0, 0, 0, 0, 0, 6, 7, 8, 9, and 10 through the loop. If
NOINPUT
isn't defined, the user will be asked to input the number.
for(int i = 1 ; i <= 10; i++)
{
int num = 0;
#ifdef NOINPUT
if(i > 5)
{
num = i;
}
#else
{
cout << "Enter a number:";
cin >> num;
}
#endif