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 difference between && and & in c?
What is atoi and atof in c?
What is memcpy() function?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
Can one function call another?
What is cohesion in c?
What is selection sort in c?
Differentiate abs() function from fabs() function.
What is the method to save data in stack data structure type?
What is an lvalue?
What is meant by 'bit masking'?
What is hashing in c?
Explain output of printf("Hello World"-'A'+'B'); ?
Write a program to print factorial of given number without using recursion?
Why pointers are used?