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

write a C code To reverse a linked list

2 Answers   Motorola, Wipro,


how to make program without <> in library.

1 Answers   ADITI,


How can I insert or delete a line (or record) in the middle of a file?

0 Answers  


x=2,y=6,z=6 x=y==z; printf(%d",x)

13 Answers   Bharat, Cisco, HCL, TCS,


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

0 Answers  


without using arithmatic operator solve which number is greater??????????

1 Answers   Accenture,


What is the difference between text and binary i/o?

0 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300

4 Answers   Tieto,


Can you think of a way when a program crashed before reaching main? If yes how?

2 Answers  


List some of the dynamic data structures in C?

0 Answers  


What does extern mean in a function declaration?

4 Answers  


What is the difference between scanf and fscanf?

0 Answers  


Categories