I am curious to know can we use default keyword without switch ? If it can't be done. so can anyone tell why it can't be done.
If it's possible to do so what's the problem in my code it shows error before default
Code:#include<stdio.h>
#define Var 3
int main()
{
if ( Var == 2 )
{
printf(" 2 \n" );
}
if ( Var == 5)
{
printf(" 5 \n" );
}
if ( Var == 4)
{
printf(" 4 \n" );
}
default
{
printf(" Not Valid \n" );
}
return 0;
}