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 / simply rockz

in ternary operator a condition is required/// like..
<condition1>?<result1>:<result2>

b=(a=0)?2:3
so.. illegal use of ternary.../* "=" is an assignment operator*/

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1783


Write a program to print fibonacci series without using recursion?

611


What is difference between union All statement and Union?

628


Why & is used in scanf in c?

627


What are the different types of C instructions?

679






How can I read a binary data file properly?

635


What is the purpose of the preprocessor directive error?

683


Explain how can I remove the trailing spaces from a string?

626


develop algorithms to add polynomials (i) in one variable

1746


Simplify the program segment if X = B then C ← true else C ← false

2588


Do you know pointer in c?

594


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

759


What are the keywords in c?

644


What are formal parameters?

662


What are local variables c?

552