-
printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}
">Union u{ union u { int i; int j; }a[10]; int b[10];}u;main(){ printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a));// printf("%d", sizeof(u.a[4].i));}
A) None of the AboveB) 1, 100, 1C) 40, 4, 4D) 4, 4, 4Explanation: 20, 200, error for 3rd printf
-
-
Given the values of two nodes in a *binary search tree*, write a cprogram to find the lowest common ancestor. You may assume that bothvalues already exist in the tree.The function prototype is as follows:int FindLowestCommonAncestor(node* root,int value1,int value) 20 / 8 22 / 4 12 / 10 14I/P : 4 and 14O/P : 8(Here the common ancestors of 4 and 14, are {8,20}. Of {8,20}, the lowest one is 8).
One of the solution can be to find out postorder traversal taking each node one by one. This postorder function should return true if both the values (v1 & v2) are found in the postorder traversal of the given node. NOTE: The given tree is a BST.... think over it......
-
-
-
-
Image in C Program Console
How to put Image in C Program Console
-
-
Execute Shell Command
How will you execute shell command without using system command in C-language? Write a program to execute ls -l and redirect the output to a file, without using system command ?
-
-
-
TSR
Explain How Terminate & Stay Resident (TSR) and Offline programming differ from one another.
-
If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i<argc;i++) printf("%s",argv[i]); }
A) 1 2 3B) C:MYPROG.EXE123C) MYPD) None of the above
-
-
-
Write sample code or algorithim to get all possible combinations of data that will be entered from keyboard
like, If i enter 1 2 3 then it should show 1 2 31 3 2 2 1 3 All 6 possible combnations
-
Allocate Arrays or Structures
How to allocate arrays or structures bigger than 64K?
-
Return Multiple Values from Function
How to return multiple values from a function?
-
Call a Function
How to call a function, given its name as a string?
-
Hello World
Write a program in C to display output as "hello world" without using semicolon(;)?
C Interview Questions
Ans