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

what is meant by flushll() in c programming?

1 Answers  


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

0 Answers  


What is an example of enumeration?

1 Answers  


What is meant by preprocessor in c?

0 Answers  


WHAT IS MAXIMUM SIZE OF AN ARRAY IN C LANGUAGE?

8 Answers   Carphone Warehouse, IBM, SAS,






What is the difference between a string and an array?

0 Answers  


All technical questions

0 Answers   TCS,


Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?

2 Answers  


can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance

1 Answers   IBM,


Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning

4 Answers   Accenture,


Can you tell me how to check whether a linked list is circular?

1 Answers  


what is function pointer?

2 Answers   Wipro,


Categories