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 / vignesh1988i
the value is 0 so this will go to 3.. the value of b=3
a) b=3... since we are not comparing the value os a's...
this is an assignment statement.... so a itself is 0, which
is an false condition.... so it moves to 3
b) the value of b=2... since -1 ia an non zero value... the
whole term wil become true....
c) b=2... same reson as above
actually the above conditional operater statement must be
full y enclosed witin braces.... then only we should assign
to a variable....
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What are the primitive data types in c?
How can I sort a linked list?
In C programming, what command or code can be used to determine if a number of odd or even?
Why c language?
What are the types of c language?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is the significance of c program algorithms?
Is flag a keyword in c?
Explain a pre-processor and its advantages.
Are negative numbers true in c?
What will the preprocessor do for a program?
What does malloc () calloc () realloc () free () do?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Why c is called a mid level programming language?