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 / syamkumarm
a)3
because it is ternery operator its work like a if.. else..
in the comdition part a=0 i.e. the result of expression is
zero so it goes to else part i.s 3
b)b=3
c)b=2
| Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
How do you convert strings to numbers in C?
Linked lists -- can you tell me how to check whether a linked list is circular?
How can I find the modification date and time of a file?
Does c have enums?
What is main () in c language?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
p*=(++q)++*--p when p=q=1 while(q<=6)
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Can a function argument have default value?
What is the difference between union and anonymous union?
Can math operations be performed on a void pointer?
How will you find a duplicate number in a array without negating the nos ?
What is the difference between array and linked list in c?
How do you determine the length of a string value that was stored in a variable?