Sail E0 Webinar
Question


Point out the error in the program


#include<stdio.h>
int main()
{
int i;
#if A
printf("Enter any number:");
scanf("%d", &i);
#elif B
printf("The number is odd");
return 0;
}
Options:
A .  Error: unexpected end of file because there is no matching #endif
B .  The number is odd
C .  Garbage values
D .  None of above
Answer: Option A

The conditional macro #if must have an #endif. In this program there is no #endif

statement written.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers