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

11/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>
static int x = 5;
void main()
{
    x = 9;
    {
        int x = 4;
    }
    printf("%d", x);
}

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Automatic variables are allocated memory in . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void f();
int main()
{
    #define max 10
    f();
    return 0;
}
void f()
{
    printf("%d\n", max * 10);
}

Select an option to see the answer and solution.

Which of the following is true for the static variable?

Select an option to see the answer and solution.

What will be the data type returned for the following C function?
#include <stdio.h>
int func()
{
    return (double)(char)5.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()
{
    static int x = 3;
    x++;
    if (x <= 5)
    {
        printf("hi");
        main();
    }
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 3;
    {
        x = 4;
        printf("%d", x);
    }
}

Select an option to see the answer and solution.

Property which allows to produce different executable for different platforms in C is called?

Select an option to see the answer and solution.

Which of the following file extensions are accepted with #include?

Select an option to see the answer and solution.

Which variable has the longest scope in the following C code?
#include <stdio.h>
int b;
int main()
{
    int c;
    return 0;
}
int a;

Select an option to see the answer and solution.

Which of the following sequences are unaccepted in C language?

Select an option to see the answer and solution.

Comment on the output of the following C code.
#include <stdio.h>
int main()
{
    int i;
    for (i = 0;i < 5; i++)
    int a = i;
    printf("%d", a);
}

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();
    return 0;
}
void foo()
{
    printf("2 ");
}

Select an option to see the answer and solution.

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

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 defined(MIN) - (!defined(MAX))
#define MAX 10
#endif
int main()
{
    printf("%d %d\n", MAX, MIN);
    return 0;
}

Select an option to see the answer and solution.

The preprocessor provides the ability for . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    static double x;
    int x;
    printf("x is %d", x);
}

Select an option to see the answer and solution.

Which of the following operation is not possible in a register variable?

Select an option to see the answer and solution.

Which of the following Macro substitution are accepted in C?

Select an option to see the answer and solution.