a=5
a=a++/++a
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / ss
answer can be 2 and 1 as well
actually it is compiler dependent
Is This Answer Correct ? | 0 Yes | 4 No |
write a program to remove duplicate from an ordered char array? in c
how to use enum datatype?Please explain me?
please can some one guide me, to the answer Write a C program to enter 15 numbers as an input from the keyboard and program will find and print odd numbers and their average. i have studied while and do while loop for loop if and else if switch
What are the restrictions of a modulus operator?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.
Who invented bcpl language?
Why doesn't C support function overloading?
Here is a neat trick for checking whether two strings are equal
Can a file other than a .h file be included with #include?
write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.
What is the output of below code? main() { static in a=5; printf("%3d",a--); if(a) main(); }