ExamVeda
Login
Home
51
Which operator from the following has the lowest priority?
Discuss
Answer & Solution
Answer: Option C
Solution:
52
Identify the correct output of the following code:
void main()
{
   int w=10, x=5, y=3, z=3;
   if( (w < x ) && (y=z++) )
      printf("%d %d %d %d", w, x, y, z);
   else
      printf("%d %d %d %d", w, x, y, z);
}
Discuss
Answer & Solution
Answer: Option B
Solution:
As the first condition ( w < x) is false and the logical operator && is used, the entire relation becomes false and the second part ( y = z++) is not executed.
53
Given b=110 and c=20, what is the value of 'a' after execution of the expression a=b-=c*=5?
Discuss
Answer & Solution
Answer: Option B
Solution:

As the expression is evaluated from right to left.

54
what will be the output when following code is executed?
void main()
{
   int a=10, b;
   b = a++ + ++a;
   printf("%d %d %d %d", b, a++, a, ++a);
}
Discuss
Answer & Solution
Answer: Option E
Solution:
Step 1:
Initialize a with the value 10.

Step 2:
Declare b without initialization (the initial value is undefined).

Step 3:
Evaluate a++ (post-increment):
  - The current value of a is 10.
  - After evaluating a++, a becomes 11.

Step 4:
Evaluate ++a (pre-increment):
  - ++a increments a to 12 and returns the updated value, which is 12.

Step 5:
Sum the values obtained in steps 3 and 4: 10 + 12 equals 22.

Step 6:
Assign the sum (22) to b.

Step 7:
The printf function follows the stack Last-In-First-Out (LIFO) concept, which means that the expressions are evaluated from right to left.

Step 8:
The first expression to be evaluated is ++a:
  - ++a increments a to 13 and returns the updated value, which is 13.

Step 9:
The next expression to be evaluated is a++:
  - a++ returns the current value of a (13) and then increments a to 14.
  - The returned value is 13.

Step 10:
Finally, the last expression to be evaluated is a, which has the current value of 14.

Therefore, the output of the program will be:
22 13 14 14

This output corresponds to the value of b, followed by the evaluated values of a++, a, and ++a, respectively, in the printf statement.
55
Which among the following statement is right?
Discuss
Answer & Solution
Answer: Option C
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>
int main()
{
    float a = 2.455555555555;
    printf("%f", a);
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
Which of the following % operation is invalid?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
58
In the following C code, the union size is decided by?
union temp
{
    char a;
    int b;
    float c;
};
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
59
Modulus for float could be achieved by?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
60
Which among the following has the highest precedence?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board