Function MCQs

223 questionsC-ProgramPage 12 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 100easy
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++;
}
Question 101easy
What is the format identifier for "static a = 20.5;"?
Question 102easy
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
}
Advertisement
Question 103easy
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);
}
Question 104easy
Which directory the compiler first looks for the file when using #include?
Question 105easy
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;
}
Advertisement
Question 106easy
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);
}
Question 107easy
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);
}
Question 108easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    m();
}
void m()
{
    printf("hi");
    m();
}
Function MCQs with Answers & Solutions — C-Program | GrabStudy