Computer Science, asked by prosnehal7, 1 month ago

What is the output of following if y = 11 initially?
(i) 10 * + + y - 1;
(ii) + + y + y ++;​

Answers

Answered by Amido23
2

i) 119                     << 10 x ++ y - 1;

ii) 23

Hope I helped

Answered by BrainlyProgrammer
9

Answer:

Initially, y=11

  • 10 * ++y - 1

Apply BEDMAS Rule

 \begin{gathered} \orange{ \tt{10* +  + y - 1}} \\ :\implies 10* +  + 11 - 1 \\ : \implies 10*12 - 1 \\ : \implies120 - 1 \\  : \implies \orange{ \underline{ \boxed{119}}}  \end{gathered}

__________________

  • ++y + y++

Note here one is prefix and the other is postfix

 \begin{gathered} \orange{ \tt +  + y + y +  + } \\ :  \implies\tt  +  + 11 +y +  +  \\ :  \implies12 + 12 +  +  \\:  \implies 12 + 12 \:   \\  \tt\green{\backslash \backslash \: now \: a \: becomes \: 13} \\  :  \implies \bold{ \orange{ \underline{24}}} \end{gathered}

__________________

•••♪

Similar questions