TOTAL QS = 20Time [ 00 : 00 : 00 ]
00:00:00

C Programming Basics Tutorial - PreProcessor Directives - Online Test 2

Instructions

Total Questions: 20

Total Minutes: 20

This ExamTray Free Online Exam or MCQ Quiz tests your C Preprocessor Directives like Macros, Conditional Compilation(#IFDEF, #ENDIF), File Inclusion #INCLUDE, #UNDEF, #PRAGMA etc. Examples are given as questions and answers. Easily Attend Competitive Exams and Job Interview Questions.

Go through C Theory Notes on Preprocessor Directives before taking this test.

All the Best

Challenge SCORE

0 / 20

Take This Exam
1) What does #include stdio.h does in c language.?
2) What is the abbreviation of C STDIO in stdio.h.?
3) Choose a correct statement about #include<stdio.h>.?
4) Choose a correct C statement about #include"
5) In Turbo C, Search Path of Directories for #Include is mentioned under the option.?
6) Choose a correct form of using C Conditional Compilation commands IF ELSE .?
7) What is the output of C program with conditional compilation commands.?
#define CVV 156
int main()
{
    #ifdef CVV
        printf("CVV YES");
    #else
        printf("CVV NO");
    #endif
    return 0;
}
8) What is the output of C program with conditional compilation commands.?
#define CVV 156
int main()
{
    #ifdef cvv
        printf("CVV YES");
    #else
        printf("CVV NO");
    #endif
    return 0;
}
9) What is the output of C program with preprocessor directives.?
int main()
{
    #ifdef CVV
        printf("CVV YES");
    #else
        #define CVV 199
    #endif
    printf("NEW CVV=%d",CVV);
    return 0;
}
10) What is the output of C program.?
int main()
{
    #ifndef CVV
        #define CVV 199
        printf("CVV=%d", CVV);
    #else
        printf("CVV=%d", 188);
    #endif
    return 0;
}
11) What is the output of C program with Preprocessor directives.?
void show();
int main()
{
    #ifndef CVV
        #define CVV 199
    #endif
    show();
    return 0;
}
void show()
{
    printf("CVV=%d",CVV);
}
12) What is the output of C program with preprocessor directives.?
int main()
{
    #ifdef CVV
        #define CVV 199
    #elif PVV
        printf("Inside ELIF");
    #else
        printf("Inside ELSE");
    #endif
    return 0;
}
13) What is the output of C program with #undef.?
#define BIRD 5
int main()
{
    #ifdef BIRD
        printf("BIRD=5.");
    #else
        printf("UNKNOWN.");
    #endif
    #undef BIRD
    #define BIRD 10
    printf("BIRD=%d",BIRD);
    return 0;
}
14) What is the output of C program with #undef.?
int main()
{
    #undef BIRD
    printf("OKAY");
    return 0;
}
15) What is a Pragma in C language.?
16) What is the C Pragma directive or command to execute a particular function at startup of program.?
17) What is the output of C program with Pragma.?
void show1();
void show2();
#pragma startup show1
#pragma exit show2
int main()
{
    printf("MAIN.");
}
void show1()
{
    printf("START.");
}
void show2()
{
    printf("END.");
}
18) At what stage of building a C program does Pragma work.?
19) Choose a correct implementation of C Pragma Warning.?
20) Choose a correct statement about C Macro.?
Certification Group ID
3864

Open Certification Helper Popup Reset Popup