C Preprocessor

Q1:
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;
}

A Error: unexpected end of file because there is no matching #endif

B The number is odd

C Garbage values

D None of above

ANS:A - Error: unexpected end of file because there is no matching #endif

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



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.