a=0;
b=(a=0)?2:3;
a) What will be the value of b? why
b) If in 1st stmt a=0 is replaced by -1, b=?
c) If in second stmt a=0 is replaced by -1, b=?
Answer Posted / syamkumarm
a)3
because it is ternery operator its work like a if.. else..
in the comdition part a=0 i.e. the result of expression is
zero so it goes to else part i.s 3
b)b=3
c)b=2
| Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
What is the advantage of an array over individual variables?
Write a program to swap two numbers without using third variable?
What is queue in c?
What is 'bus error'?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
When would you use a pointer to a function?
Write a program for Overriding.
What is the heap?
What is the difference between typedef and #define?
Why c is faster than c++?
What is a buffer in c?
What is the use of typedef in structure in c?
What are the 4 data types?
What is the heap in c?
Explain the difference between exit() and _exit() function?