Awesome q2a theme
0 votes
24 views

ago in Programming by (2 points) | 24 views
0
b -= a--; // b = b - a--;

 

But as per Dennis Ritchie b=b-(a--)

1 Answer

+1 vote
#include <stdio.h>
int main()
{
  int a=21;
  int b, b1;
  b = a++; // b = 21 a = 22
  b1 = ++a; // b1 = a = 23
  ++a; // a = 24 
  a--; // a = 23
  b -= a--; // b = b - a--; b = -2 a = 2
  printf("%d", b); // prints -2 
  return 0;
}

 

ago by (2.9k points)
edited ago by
+1
why a=2?

 b = a++; // b = 21 a = 2
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.
8,968 questions
3,119 answers
14,340 comments
95,792 users