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
What is a node in c?
Explain how does flowchart help in writing a program?
What is malloc and calloc?
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 function of pragma directive in c?
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;i
Define and explain about ! Operator?
How can I read in an object file and jump to locations in it?
In a byte, what is the maximum decimal number that you can accommodate?
How the c program is executed?
Explain pointer. What are function pointers in C?
How many levels deep can include files be nested?
What are the differences between Structures and Arrays?
What is the description for syntax errors?
How to write a multi-statement macro?