Awesome q2a theme
0 votes
11 views
int a=5;

a= --a+a++;

Then value of a is ?
in Programming by (6 points) | 11 views
0
Is it C?

If yes, then invalid question. It's undefined behaviour.

If no, and it's abstract example then,

+ Is left associative, so, --a should be evaluated first, which will set $a=4$ and this 4 will be used, now for the right part, a++ will be evaluated so, a becomes 5 but old value is used so, $a=4$ for right hand side of the +.

So, it becomes $a=4+4;$ So, $a =8$.

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Jun 2020
  1. ummokkate

    8 Points

  2. nehaPal13

    7 Points

  3. Muktiyar

    6 Points

  4. Taraka

    6 Points

  5. pratyush12

    6 Points

  6. Radheram

    6 Points

  7. amare123

    6 Points

  8. vps123

    4 Points

  9. reboot

    2 Points

  10. Chinmay Agnihotri

    2 Points

7,415 questions
1,744 answers
10,719 comments
90,375 users