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

8/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>
#define foo(m, n) " m ## n "
int main()
{
    printf("%s\n", foo(k, l));
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int one = 1, two = 2;
    #ifdef next
    one = 2;
    two = 1;
    #endif
    printf("%d, %d", one, two);
}

Select an option to see the answer and solution.

If the file name is enclosed in angle brackets, then . . . . . . . .

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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);
}

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()
{
    if (i == 0)
        printf("true\n");
    return 0;
}

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.

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);
}

Select an option to see the answer and solution.

The "else if" in conditional inclusion is written by?

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()
{
    if (i == NULL)
        printf("true\n");
    return 0;
}

Select an option to see the answer and solution.

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;

Select an option to see the answer and solution.

What is the scope of a function?

Select an option to see the answer and solution.

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]);
}

Select an option to see the answer and solution.

The C-preprocessors are specified with . . . . . . . . symbol.

Select an option to see the answer and solution.

Automatic variables are stored in . . . . . . . .

Select an option to see the answer and solution.

Register variables reside in . . . . . . . .

Select an option to see the answer and solution.

For each #if, #ifdef, and #ifndef directive.

Select an option to see the answer and solution.

Automatic variables are . . . . . . . .

Select an option to see the answer and solution.

Comment on the output of the following C code.
#include <stdio.h>
#include "test.h"
#include "test.h"
int main()
{
    //some code
}

Select an option to see the answer and solution.

Property of the external variable to be accessed by any source file is called by the C90 standard as . . . . . . . .

Select an option to see the answer and solution.