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

6/12

Page

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

What is the format identifier for "static a = 20.5;"?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define COLD
int main()
{
    #ifdef COLD
    printf("COLD\t");
    #undef COLD
    #endif
    #ifdef COLD
    printf("HOT\t");
    #endif
}

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which directory the compiler first looks for the file when using #include?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#define foo(x, y) x / y + x
int main()
{
    int i = -6, j = 3;
    printf("%d\n",foo(i + j, 3));
    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 m()
{
    printf("hello");
}
void main()
{
    int k = m();
    printf("%d", k);
}

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 auto 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>
void main()
{
    m();
}
void m()
{
    printf("hi");
    m();
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void foo();
int main()
{
    void foo(int);
    foo(1);
    return 0;
}
void foo(int i)
{
    printf("2 ");
}

Select an option to see the answer and solution.

Which of the following is an external variable in the following C code?
#include <stdio.h>
int func (int a)
{
    int b;
    return b;
}
int main()
{
    int c;
    func (c);
}
int d;

Select an option to see the answer and solution.

C preprocessors can have compiler specific features.

Select an option to see the answer and solution.

In a conditional inclusion, if the condition that comes after the if is true, then what will happen during compilation?

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 37
    printf("%d", max);
}

Select an option to see the answer and solution.

Which of the following properties of #define is not true?

Select an option to see the answer and solution.

What is a preprocessor?

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
#if 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 is the scope of an external variable?

Select an option to see the answer and solution.

What is the sequence for preprocessor to look for the file within <>?

Select an option to see the answer and solution.

What is the scope of an automatic variable?

Select an option to see the answer and solution.

Which of the following is a storage specifier?

Select an option to see the answer and solution.