Function MCQs

223 questionsC-ProgramPage 17 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 145easy
What will be the output of the following C code?
#include <stdio.h>
void func();
int main()
{
    static int b = 20;
    func();
}
void func()
{
    static int b;
    printf("%d", b);
}
Question 146easy
What will be the output of the following C code?
#include <stdio.h>
int *i;
int main()
{
    if (i == 0)
        printf("true\n");
    return 0;
}
Question 147easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    #define max 37;
    printf("%d", max);
}
Advertisement
Question 148easy
What will be the output of the following C code?
#include <stdio.h>
#define Cprog
int main()
{
    int a = 2;
    #ifdef Cprog
    a = 1;
    printf("%d", Cprog);
}
Question 149easy
The "else if" in conditional inclusion is written by?
Question 150easy
What will be the output of the following C code?
#include <stdio.h>
int *i;
int main()
{
    if (i == NULL)
        printf("true\n");
    return 0;
}
Advertisement
Question 151easy
What will be the output of the following C code if these two files namely test.c and test1.c are linked and run?
-------file test.c-------
#include <stdio.h>
#include ""test.h""
int main()
{
  i = 10;
  printf(""%d "", i);
  foo();
}

-----file test1.c------
#include <stdio.h>
#include ""test.h""
int foo()
{
  printf(""%d\n"", i);
}

-----file test.h-----
#include <stdio.h>
#include <stdlib.h>
static int i;
Question 152easy
What is the scope of a function?
Question 153easy
What will be the output of the following C code (after linking to source file having definition of ary1)?
#include <stdio.h>
int main()
{
    extern ary1[];
    printf("%d\n", ary1[0]);
}