Vidyalelo
C Programming · all questions

Function
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

223

Questions

5/12

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following C code?
#include <stdio.h>
enum m{JAN, FEB, MAR};
enum m foo();
int main()
{
    enum m i = foo();
    printf("%d\n", i);
}
int  foo()
{
    return JAN;
}

Select an option to see the answer and solution.

C preprocessor is conceptually the first step during compilation.

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    register const int i = 10;
    i = 11;
    printf("%d\n", i);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define foo(m, n) m * n = 10
int main()
{
    printf("in main\n");
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define MIN 0);
#ifdef MIN
#define MAX 10
#endif
int main()
{
    printf("%d %d\n", MAX, MIN
    return 0;
}

Select an option to see the answer and solution.

Which among the following is wrong for "register int a;"?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    #define max 45
    max = 32;
    printf("%d", max);
}

Select an option to see the answer and solution.

Array sizes are optional during array declaration by using . . . . . . . . keyword.

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int i;
int main()
{
    extern int i;
    if (i == 0)
        printf("scope rules\n");
}

Select an option to see the answer and solution.

How is search done in #include and #include"somelibrary.h" normally or conventionally?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    #define const int
    const max = 32;
    printf("%d", max);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define MIN 0
#ifdef(MIN)
#define MAX 10
#endif
int main()
{
    printf("%d %d\n", MAX, MIN);
    return 0;
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    register int i = 10;
    int *p = &i;
    *p = 11;
    printf("%d %d\n", i, *p);
}

Select an option to see the answer and solution.

The #elif directive cannot appear after the preprocessor #else directive.

Select an option to see the answer and solution.

Preprocessor feature that supply line numbers and filenames to compiler is called?

Select an option to see the answer and solution.

Which function definition will run correctly?

Select an option to see the answer and solution.

#pragma exit is primarily used for?

Select an option to see the answer and solution.

Which data type can be stored in register?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void m();
void n()
{
    m();
}
void main()
{
    void m()
    {
        printf("hi");
    }
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    register int x = 5;
    m();
    printf("x is %d", x);
}
void m()
{
    x++;
}

Select an option to see the answer and solution.