Computer Science, asked by chandankr11189, 3 months ago

a++ + ++b%a-- + if a=15 and b=6​

Answers

Answered by BrainlyProgrammer
5

To solve:-

  • a++ + ++b%a-- + a

Given:-

  • a=15
  • b=6

Let's Solve...

a++ + ++b% a-- + a

15 + 7%16 +15

15+ 7 +15

37

Correct Answer:-

  • a=15
  • b=7
  • a++ + ++b% a-- + a = 37

Always Remember!

  • Prefix Operators :- They increase/decrease their value before moving forward. ++x,--x are prefix increment/decrement operator.

  • Postfix Operators :- They increase/decrease their value after moving forward. ++x,--x are prefix increment/decrement operator.

Operator Precedence:-

 \:  \:  \: \begin{gathered}\boxed{ \begin{array}{c|c}\tt \underline{Operators}:&\tt\underline{Hierarchy}:\\ \tt( \: ),[ \: ]&\tt1\\ ++,--,\sim,!& \tt2\\ \tt *,/,\%&\tt3\\ +,-&\tt4 \\ \tt > > , > > > , < < &\tt5\\ \tt > , > =, < , < =&\tt6\\ \tt ==,!= &\tt7\\ \& &\tt8\\ \tt ^{\wedge}&\tt9\\ \tt !&\tt10\\ \tt\&\& & \tt11 \\ \tt ||&\tt12\\ \tt ?=&\tt13\\ \tt =&\tt14 \end{array}}\end{gathered}

Similar questions