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

How can we open a file in Binary mode and Text mode?what is the difference?

1 Answers   PanTerra,


inline function is there in c language?

4 Answers  


how to execute a program using if else condition and the output should enter number and the number is odd only...

0 Answers  


If an old women's age is the same as her three grand daughters i,mean the number of days old child=the no of weeks old child=no of months old child .The total yrs of all these ppl is 114 yrs...then how old is the old woman? the yr has 365 days..and 30 days each month.

1 Answers   TCS,


How can I ensure that integer arithmetic doesnt overflow?

0 Answers  


Q.11 Generate the following pattern using code in any language(c/c++/java) for n no. of rows 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

2 Answers  


Is there a way to switch on strings?

0 Answers  


Why do u use # before include in a C Progam?

9 Answers   IBM,


convert 12345 to 54321 withoutusing strig

5 Answers  


What is the use of extern in c?

0 Answers  


What is the difference between class and object in c?

0 Answers  


write a proram to reverse the string using switch case?

0 Answers   Syntel,


Categories