638 views
0 votes
0 votes

Consider the following C program

     

Which of the following represents output of above program ?

1 Answer

4 votes
4 votes
Output of the above program : 2 2

p = -3;

q = 2;

r = 0;

s = ++p  && ++q || r++;

s =  -2 && 3 || 0      (    true && true || false   =  true  ( Left to right  ) )  

Hence s = 1

Now  t = p + q + s++  

t = -2 + 3 + 1     = 2

Now s become 2 , post increment  

So , s = 2 and t = 2.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
tishhaagrawal asked Dec 16, 2023
355 views
Below is my approach to solving this question, can anyone please explain if I am doing it the right way?Let X = #free slotssince, m =7 and n = 3So, $4 \leqslant x\leqsla...
0 votes
0 votes
1 answer
4
jugnu1337 asked Oct 22, 2023
353 views
Suppose A is a 12 by 9 incidence matrix from a connected (but unknown) graph with 9 nodes and 12 edges. The diagonal entries of $A^{T}.A$give the number of edges into eac...