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 / simply rockz

in ternary operator a condition is required/// like..
<condition1>?<result1>:<result2>

b=(a=0)?2:3
so.. illegal use of ternary.../* "=" is an assignment operator*/

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a node in c?

535


Explain how does flowchart help in writing a program?

613


What is malloc and calloc?

556


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.?

608


what is the function of pragma directive in c?

602






You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2694


Define and explain about ! Operator?

603


How can I read in an object file and jump to locations in it?

561


In a byte, what is the maximum decimal number that you can accommodate?

613


How the c program is executed?

616


Explain pointer. What are function pointers in C?

614


How many levels deep can include files be nested?

638


What are the differences between Structures and Arrays?

591


What is the description for syntax errors?

600


How to write a multi-statement macro?

610