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 / ashwin kumar molugu

a)1st answer will be 3
in statement 1
b)if a=0 replaced with -1 its an error
in statement 2
c)if a=0 replaced with -1 2

answer is 2 becoz -1 is taken as true in c language

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c so popular?

650


how to construct a simulator keeping the logical boolean gates in c

1731


Explain what is wrong with this program statement?

621


What is the general form of function in c?

611


What is the purpose of the preprocessor directive error?

683






What is a buffer in c?

576


Explain what is the use of a semicolon (;) at the end of every program statement?

737


Write a progarm to find the length of string using switch case?

1612


Why do we use c for the speed of light?

606


Why use int main instead of void main?

599


Write a program to reverse a linked list in c.

647


What do you mean by c?

590


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

676


What is indirection?

653


Explain how can I make sure that my program is the only one accessing a file?

629