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

Tell us bitwise shift operators?

593


Explain data types & how many data types supported by c?

578


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2264


Which is best book for data structures in c?

594


What is an example of structure?

586






What is the value of h?

589


What is scope rule in c?

603


Is stack a keyword in c?

632


What is malloc calloc and realloc in c?

660


What do you mean by dynamic memory allocation in c? What functions are used?

650


What does sizeof return c?

598


Why double pointer is used in c?

563


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9651


How can I trap or ignore keyboard interrupts like control-c?

618


Explain function?

663