ExamVeda
Login
Home
51
What will be the output of the following C code?
#include <stdio.h>
int x = 5;
void main()
{
    int x = 3;
    printf("%d", x);
    {
        x = 4;
    }
    printf("%d", x);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
52
Which part of the program address space is p stored in the following C code?
#include <stdio.h>
int *p = NULL;
int main()
{
    int i = 0;
    p = &i;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
53
What would happen if you create a file stdio.h and use #include "stdio.h"?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
54
What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
    printf("%d", x);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
55
Automatic variables are initialized to . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
56
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
Functions can return enumeration constants in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
58
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
59
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;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
60
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;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board