postfix, prefix
a=10 b=15
(++a)+(a++)+(++a)+(b++)+(++b)
Answers
Answered by
7
Answer:
Given :
- a = 10
- b = 15
Solution :
Postfix and Prefix :
(++a) + (a++) + (++a) + (b++) + (++b)
- ++a ( Prefix Increment )
++a = 1 + a
⟶ 1 + 10
⟶ 11
++a = 11
- a++ ( Postfix Increment )
⟶ a + 1
⟶ 10 + 1
⟶ 11
a++ = 11
- ++a ( Prefix Increment )
⟶ 1 + a
⟶ 1 + 10
⟶ 11
++a = 11
- b++ ( Postfix Increment )
⟶ b + 1
⟶ 15 + 1
⟶ 16
b++ = 16
- ++b ( Prefix Increment )
⟶ 1 + b
⟶ 1 + 15
⟶ 16
++b = 16
⟶ 11 + 11 + 11 + 16 + 16
⟶ 33 + 32
⟶ 65
______________
• Increment ( adding 1 to ) and decrementing ( substracting 1 from ) a variable are so common that they have their own operators in C.
• Prefix Increment - ++x - Increment x, then evaluate x
• Postfix Increment - x++ - Decrement x, then Increment x
Answered by
0
┏━━━━•❅•°•❈ - •°•❅•━━━━┓
Here's your answer ⏎
┗━━━━•❅•°•❈ - •°•❅•━━━━┛
Latitude ✍
➽ Asia lies between 10 degree to 80 degree north.
Longitude ✍
➽ Asia lies between longitude 25 degree east and 170 degree east.
☘Hope it helps❢❢
⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷⊷
Similar questions
Social Sciences,
1 month ago
World Languages,
1 month ago
Math,
1 month ago
Physics,
3 months ago
Biology,
9 months ago
English,
9 months ago
Social Sciences,
9 months ago