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
What is a pragma?
What are the types of pointers in c?
What is #define used for in c?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
What is the difference between scanf and fscanf?
What is void main ()?
What is printf () in c?
What is this pointer in c plus plus?
In c programming language, how many parameters can be passed to a function ?
Is fortran still used today?
What is the difference between local variable and global variable in c?
What is the difference between a free-standing and a hosted environment?
Are there any problems with performing mathematical operations on different variable types?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What is chain pointer in c?