In your code, Val_MAX
being a #define
d value to 0
if(Val_MAX)
is actually (you can check after preprocessing with gcc -E
)
if(0)
which is not of any worth. The Following printf()
will never execute.
FWIW, a selection statement like if
needs an expression, for which the value evaluation will be expectedly be done at runtime. For a fixed value, a selection statement makes no sense. It's most likely going to end up being an "Always TRUE" or "Always FALSE" case.
One Possible solution: [With some actual usage of selection statement]
Make the Val_MAX
a variable, ask for user input for the value, then use it. A pseudo-code will look like
#include <stdio.h>
int main(void)
{
int Val_MAX = 0;
printf("Enter the value of Val_MAX\n");
scanf("%d", &Val_MAX);
if(Val_MAX)
printf("The value is %d",VALUE_MAX);
return 0;
}