QUESTION+BANK+-+C+PROGRAMMING
QUESTION+BANK+-+C+PROGRAMMING
com
C PROGRAMMING
34. How will you declare an array of three function pointers where each function
receives two ints and returns a float?
35. What is a NULL Pointer? Whether it is same as an uninitialized pointer?
36. What is a NULL Macro? What is the difference between a NULL Pointer and a NULL
Macro?
37. What does the error 'Null Pointer Assignment' means and what causes this error?
38. What is near, far and huge pointers? How many bytes are occupied by them?
39. How would you obtain segment and offset addresses from a far address of a
memory location?
40. Are the expressions arr and & arr same for an array of integers?
41. Does mentioning the array name gives the base address in all the contexts?
42. Explain one method to process an entire string as one unit?
43. What is the similarity between a Structure, Union and enumeration?
44. Can a Structure contain a Pointer to itself?
45. How can we check whether the contents of two structure variables are same or
not?
46. How are Structure passing and returning implemented by the complier?
47. How can we read/write Structures from/to data files?
48. What is the difference between an enumeration and a set of pre-processor #
defines?
49. What do the 'c' and 'v' in argc and argv stand for?
50. Are the variables argc and argv are local to main?
51. What is the maximum combined length of command line arguments including the
space between adjacent arguments?
52. If we want that any wildcard characters in the command line arguments should
be appropriately expanded, are we required to make any special provision? If yes,
which?
53. Does there exist any way to make the command line arguments available to other
functions without passing them as arguments to the function?
54. What are bit fields? What is the use of bit fields in a Structure declaration?
55. To which numbering system can the binary number 1101100100111100 be easily
converted to?
56. Which bit wise operator is suitable for checking whether a particular bit is on or
off?
57. Which bit wise operator is suitable for turning off a particular bit in a number?
58. Which bit wise operator is suitable for putting on a particular bit in a number?
59. Which bit wise operator is suitable for checking whether a particular bit is on or
off?
115. Explain the difference b/w const char *p and char *const p.
116. What is the use of volatile key word?
117. What is the use of keyword ‘extern’?
118. How to calculate the efficiency of sorting & searching? Which is efficient?
119. How is Queue implemented?
120. Differences b/w macro & function.
121. Where is a stack used in compilation process?
122. Take 3 nodes and write statements to link these nodes.
123. Explain Sorting techniques.
124. Explain Binary search (algorithm)
125. Explain the C precedence, hierarchy.
126. What is the difference b/w #define and typedef.
127. What is the difference b/w typedef and macros?
128. Subtract 2 no. without using minus (-).
129. Write a program to implement stack.
130. Write a function to find the length of the string without using library functions.
131. Compare 2 strings without using strcmp ().
132. Where do we use union in comparison to structure?
133. Write a strcpy () function in one line?
134. Static member functions.
135. There are n elements in an array .First ‘K’ elements are reversed and then (n-K)
elements are
reversed . After that whole array is reversed. So what will be the pattern?
a) Original array will be reversed.
b) Array will be shifted K times counter clockwise.
c) Array will be shifted K times in clockwise.
d) None of the above
136. If a binary tree has K nodes, two children, L leaves then what will be relation
b/w K & L.
a) (K-L)
b) 2(K-L)
137. If there is a binary tree with three independent node X,Y, Z ,What are the
chances of getting XYZ
138. If there are two arrays of size ‘m’ and ‘n’ and if they are sorted what will be the
time complexity in merging the arrays.
139. AbCDefg is a strictly binary tree in which capital letters are nodes and small
letters are leaves .so what will be the depth of the binary tree.
141. In an unordered ‘n’ element linked list .what is the complexity of insertion &
deletion.
142. How many binary trees can be made from exactly 4 nodes?
146. Elements of an array are 24, 6, 4,1,40. Take ‘6’ as prior element and apply quick
sort on this array.
int * p ( char* );
int * ( * p )( char * );
152. Write the no. of clock cycles used to execute the following instruction.
a) CALL 020 Bh
b) OUT 20h
c) LXI SP, address
153. How do you compile different .C files, to make one executable file?
162. How will you define a function that accepts variable arguments?
170. What is the difference b/w global static and local static variable?
175. Write a program without using a semicolon to print no. from 0 to 100?
177. Write a structure that contains all data types as members .(like int, float, char,
pointer)
180. How do you insert an element in a linked list? Write the function?
189. Growth of stack and also movement of base pointer when a function is
called_________________
194. Prototype for a function pointer taking arguments as integer pointer and returning
an integer value?
199. What is the difference b/w pointer to function and function pointer?
204. Write a pointer to integer array array and access the third element?
208. What are the various data specifiers & what is the scope & life of the various data
specifiers?
210. Write a program to scan all string until you press enter and display the entered
string?
213. Evaluate the following prefix expression " ++ 26 + - 1324" (Similar types can be
asked)
214. Convert the following infix expression to post fix notation ((a+2)*(b+4)) -1
(Similar types can be asked)
221. Write the programs for Linked List (Insertion and Deletion) operations
222. What data structure would you mostly likely see in a non recursive implementation
of a recursive algorithm?
223. What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack
and Tail Recursion?
224. Explain quick sort and merge sort algorithms and derive the time-constraint
relation for these.
226. What is the maximum total number of nodes in a tree that has N levels? Note that
the root is level (zero)
227. How many different binary trees and binary search trees can be made from three
nodes that contain the key values 1, 2 & 3?
228. A list is ordered from smaller to largest when a sort is called. Which sort would take
the longest time to execute?
229. A list is ordered from smaller to largest when a sort is called. Which sort would take
the shortest time to execute?
230. When will you sort an array of pointers to list elements, rather than sorting the
elements themselves?
231. The element being searched for is not found in an array of 100 elements. What is
the average number of comparisons needed in a sequential search to determine that the
element is not there, if the elements are completely unordered?
235. Which data structure is needed to convert infix notations to post fix notations?
o Syntax Error
o Logical Error
o Runtime Error
237. In which data structure, elements can be added or removed at either end, but not
in the middle?
238. How will inorder, preorder and post order traversals print the elements of a tree?
Parenthesis are never needed in prefix or postfix expressions. Why?
239. Which one is faster? A binary search of an ordered set of elements in an array or a
sequential search of the elements
240. If a binary tree have K nodes & L leaves then what is the relation b/w them (K&L).
b) LL
c) AVL tree
Continental Company
247. What is the difference between function definition and function declaration?
248. What is stack? How is stack implemented using linked lists? Give the application of
stacks?
255. What is the difference between function definition and function declaration?
256. What is stack? How is stack implemented using linked lists? Give the application of
stacks?
260. Name different types of addressing modes? explain in detail register addressing
mode and indirect addressing mode?
263. How many flip flops are required for mod-12 counter?
Huawei
265. WAP to find 2nd highest and 2nd lowest element of an integer array.
267. Write a function to find the index of a substring in the main string?
268. WAP to calculate x to the power of n, where n is an integer, x and result should be
float?
269. Write a program to get a string from user and using a child function calculate the
string length and print the same in the main function. The child function should not
return anything and global variable are not supposed to be used.
270. Write a program to get a string from the user and print only the consonants in
them.