387 views
2 votes
2 votes
a.)  int main()

{         
      int i=10;
       i=i++;
       printf("%d",i);
}

b.)  int main()
  {
      int i=10;
     
      printf("%d %d %d",i,i++,++i);
      
  }

 

Question:

a) In part (a) i want to know that once the i value is assigned to i itself , after that increment should be done but the output

comes out to be same which is 10, i want to know y i in not incremented

b.)  The (b) part gives the output 12,11,12 and i have no idea y it is printing like this , Pls give me the explanation of both parts!

Thanks in advance :)

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
2 answers
2
Desert_Warrior asked May 16, 2016
8,789 views
#include<stdio.h int main() { int a = 5; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; }(a) 5 (b) 4 (c) 3 (d) N...
0 votes
0 votes
1 answer
3
Lakshman Bhaiya asked Sep 6, 2018
494 views
The function f(x) = |x – 2| + |2.5 – x| + |3.6 – x|, where x is a real number, attains a minimum at?x = 2.3x = 2.5x = 2.7none of the above.