Function MCQs

223 questionsC-ProgramPage 7 of 25

Practice free Function multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 223 questions — no login required.

Question 55easy
Automatic variables are initialized to . . . . . . . .
Question 56easy
What will be the output of the following C code?
#include <stdio.h>
#define MIN 0
#if defined(MIN) + defined(MAX)
#define MAX 10
#endif
int main()
{
    printf("%d %d\n", MAX, MIN);
    return 0;
}
Question 57easy
Functions can return enumeration constants in C?
Advertisement
Question 58easy
What will be the output of the following C code?
#include <stdio.h>
int foo(int, int);
#define foo(x, y) x / y + x
int main()
{
   int i = -6, j = 3;
   printf("%d ",foo(i + j, 3));
   #undef foo
   printf("%d\n",foo(i + j, 3));
}
int foo(int x, int y)
{
   return x / y + x;
}
Question 59easy
What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
    m();
    printf("%d", x);
}
void m()
{
    x = 4;
}
Question 60easy
What will be the output of the following C code?
#include <stdio.h>
int foo();
int main()
{
    int i = foo();
}
foo()
{
    printf("2 ");
    return 2;
}
Advertisement
Question 61easy
Which of following is not accepted in C?
Question 62easy
What will be the output of the following C code?
#include <stdio.h>
int *m();
void main()
{
    int k = m();
    printf("%d", k);
}
int *m()
{
    int a[2] = {5, 8};
    return a;
}
Question 63easy
Global variables are . . . . . . . .