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 / vaibhav
b=3
becoz in ternay operator if statement is true then it
returns non zero vaqlue othervise it return 0 in that case
we initialize the value of a is 0 therefore it will exicute
a else part
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Which header file is essential for using strcmp function?
What is the 'named constructor idiom'?
Can main () be called recursively?
What is an lvalue?
Explain the use of 'auto' keyword in c programming?
What is array in C
What tq means in chat?
Write a program to print ASCII code for a given digit.
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What is %d used for?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is the difference between array_name and &array_name?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?