Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


a=5
a=a++/++a

Answers were Sorted based on User's Feedback



a=5 a=a++/++a..

Answer / prasannanjaneyulu.kandimalla

a=5;
a=a++/++a;
in that numerator is 5 and denominator is 6(finally a value
is:6)
so a=6/6=1
finally a is postincremented so it is2(1+1)

Is This Answer Correct ?    17 Yes 4 No

a=5 a=a++/++a..

Answer / nirbhaykumar

a=2

Is This Answer Correct ?    16 Yes 10 No

a=5 a=a++/++a..

Answer / nikhil saraf

a=1

Is This Answer Correct ?    15 Yes 10 No

a=5 a=a++/++a..

Answer / harinath

as the above person said the answer is right but
at first the evaluation starts from denominator, according
to operator precedence pre-increment has more value than
other two(/ and post-increment)
so at first ++a=6 is assigned to a
now the value in a is 6 .so 6/6 gives the value 1.
then post-increment occurs to the value in a(ie.,1).
so the value of a is finally 2(1+1).

Is This Answer Correct ?    6 Yes 2 No

a=5 a=a++/++a..

Answer / svs

2
5=5++/++5
6=6++/6
6=6/6
6=1+increments one
answer is two

Is This Answer Correct ?    2 Yes 0 No

a=5 a=a++/++a..

Answer / ravi

a=5/7
a=0;

Is This Answer Correct ?    2 Yes 0 No

a=5 a=a++/++a..

Answer / rajesh kumar swain

here a++/++a=5/7

Is This Answer Correct ?    1 Yes 0 No

a=5 a=a++/++a..

Answer / kathir

undefined

Is This Answer Correct ?    1 Yes 2 No

a=5 a=a++/++a..

Answer / ajeet kumar

Ans a=2.

here a=a++/++a; //initial value of a=5.
1)firstly a=a++/++a <---it is pre-increment so firstly this
value will update.i.e a will be 6.
a=a++/6; //a=6
a=6/6; a=1;//after this line executions one increment will left of variable a.

Is This Answer Correct ?    0 Yes 1 No

a=5 a=a++/++a..

Answer / ss

answer can be 2 and 1 as well
actually it is compiler dependent

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More C Interview Questions

Which header file should you include if you are to develop a function which can accept variable number of arguments?

0 Answers   TCS, TISL,


what is software?

7 Answers   Wipro,


What is time complexity c?

0 Answers  


Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }

3 Answers   NDS,


Explain how do you determine the length of a string value that was stored in a variable?

0 Answers  


how should functions be apportioned among source files?

0 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

4 Answers  


Write the Program to reverse a string using pointers.

0 Answers   InterGraph,


What is break statement?

0 Answers  


what is Array?

3 Answers  


enum DAY { sunday, monday, tuesday }; enum EDAYS { friday, saturday, sunday }; void main() { int i =0; if( i == sunday) { printf("%d",i); } } what would be the output?

4 Answers   TCS,


Does sprintf put null character?

0 Answers  


Categories