ExamVeda
Login
Home
11
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 3, y = 2;
    int z = x /= y %= 2;
    printf("%d\n", z);
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
12
What will be the output of the following C code considering the size of a short int is 2, char is 1 and int is 4 bytes?
#include <stdio.h>
int main()
{
    short int i = 20;
    char c = 97;
    printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
13
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 97;
    int y = sizeof(x++);
    printf("X is %d", x);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int a = 2 + 4 + 3 * 5 / 3 - 5;
    printf("%d", a);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
A user defined data type, which is used to assign names to integral constants is called . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following C code if input given is 2?
#include<stdio.h>
enum day
{
    a,b,c=5,d,e
};
main()
{
    printf("Enter the value for a");
    scanf("%d",a);
    printf("%d",a);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int b = 6;
    int c = 7;
    int a = ++b + c--;
    printf("%d", a);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
18
What will be the final values of i and j in the following C code?
#include <stdio.h>
int x = 0;
int f()
{
    if (x == 0)
        return x + 1;
    else
        return x - 1;
}
int g()
{
    return x++;
}
int main()
{
    int i = (f() + g()) | g(); //bitwise or
    int j = g() | (f() + g()); //bitwise or
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int b = 5 & 4 & 6;
    printf("%d", b);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
20
What will be the output of the following C code?
#include <stdio.h>
void main()
{
    double b = 5 & 3 && 4 || 5 | 6;
    printf("%lf", b);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board