#include<stdio.h>
int main(){
int a=5;
printf("%d %d %d",a++,a++,++a);
return 0;
}..please explain me output 7 6 8..Thnx in advance



#include<stdio.h> int main(){ int a=5; printf("%d %d %d",a++,a++,++a); ..

Answer / abhijeet ankush gate rank 416

correct output is 766
explaination
printf function is right associative and starts reading from
right which is ++a.
in ++a value is 1st incremented and then printed
in a++ value is 1st printed and then incremented...

Is This Answer Correct ?    10 Yes 11 No

Post New Answer

More Engineering AllOther Interview Questions

What is The Need of Template?

0 Answers  


write the output for yhe given program int a=5; void main() { int a=9; printf("%d",a); } printf("%d",&a);

3 Answers   HCL,


real time examples for basic concepts in oop

0 Answers   Wipro,


Tl me folder name that has been not changed

1 Answers  


what's the difference between windows serevr 2003 or windows XP.

0 Answers   Global Computer,






Full form of Abt Meter

2 Answers   ABB,


Why Mother Board is called Mother Board & not Father Board?

12 Answers   Microsoft, Precision Infomatic, SoftStream,


Are bridges more stable on concrete or on soil - why?

0 Answers  


What is Campus selection process of patni at Adcet,Ashta at 24th dec 2010.Also give apti syllabus.

0 Answers   Patni,


which/why unix commands are simpler rather than complex tasks

0 Answers  


How to Define the defect density?

0 Answers   CFCI,


what things abutsbi

0 Answers   State Bank Of India SBI,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4452)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)