Sunday, 14 April 2013

C PROGRAMMING AND DATA STRUCTURES (VIVA)

1. What is Compiler ?
2. What is linker?
3. What is Assembler?
4. What is Preprocessor?
5. What is #define and #include in C? or What are the Preprocessor commands in C?
6. What is the purpose of header file in C program? stdio.h, conio.h, math.h, string.h, stdlib.h… etc, mention any 3 predefined functions in these header files?
7. What is Pseudo code?
8. Define Algorithm?
9. What is Flowchart ? What are the different symbols in it?
10. What is a program?
11. Explain the steps in the execution of C program?
12. Explain the Basic structure of a C program?
13. Where does the execution of a C program begin?
14. What is C?
15. Who developed C language?
16. Is C a Procedure oriented language ? Explain.
17. Is C top-down or bottom-up programming language ? Explain?
18. What are the features of C?
19. C is a portable language … Explain Portability?
20. C is a robust language… Explain robustness?
21. what are the limitations / disadvantages / drawbacks of C ?
22. What is a datatype?
23. How many datatypes in C?
24. What are the Basic Datatypes or Primitive datatypes in C ?
25. Explain the size and range of each datatypes in C ?
26. What is signed and Unsigned part of a datatype?
27. what is the size of short int , int and long int in bytes ?
28. 1 byte is… ? What is a byte ?
29. What are the Escape sequences in C?
30. Define Constants in C ? examples .
31. Define variables in C?
32. What is declaration in C?
33. What is definition of a variable in C?
34. What is the difference between Declaration and Definition of a variable?
35. Define scope and lifetimeof a variable?
36. What is the difference between the Global and Local declaration of a variable?
37. What is an Identifier?
38. What is Type Conversion/ Type casting ? Examples .
39. What is an Expression? Is there any difference between an Expression and an Equation?
40. What is the so called rule for the Evaluation of Expressions?
41. What is an Operator and Operand?
42. What is the use of Operator Precedence?
43. What is the Associativity of operators?
44. How many types of Operators in C and what are they?
45. What is the difference between Unary and Binary operators ? examples
46. Explain Bitwise operators in C?
47. What is Control structures in C?
48. Explain the Sequence structure with example?
49. Explain the Selection structure with example?
50. Explain the Iteration structure with example?
51. What is Recursion? How many types of Recursion? Explain the procedure? Explain Towers of Hanoi concept of Recursion?
52. What is the difference between Iteration and Recursion?
53. What are the Decision making statements in C? Explain with example?
54. What are the loop Control structures in C? Explain with example?
55. Flowcharts for if , if-else, else-if ladder, nested if , switch, for , while , do-while etc.,.
56. What is the syntax for if , if-else, else-if ladder, nested if , switch, for , while , do-while etc.,.
57. What is the Unconditional jumping statement in C?
58. What is difference between while and for loops ?
59. What are the Entry controlled and Exit controlled loops in C and Why?
60. Explain break, continue and goto statements in C with examples?
61. What is the difference between break and continue?
62. Why is C a structured programming language ? How is it achieved ?
63. Define a Function?
64. How many types of Functions in C?
65. What is the difference between User-defined and Standard library/Pre-defined functions?
66. Examples for User-defined functions?
67. Examples for Standard library functions?
68. Is main() a user-defined function or pre-defined function?
69. What is a Return type for a function?
70. What are the Return values in a function?
71. Classification of Functions based on Return type and Return values?
72. Explain the function with return type and return value with example?
73. Explain the function with return type and without return value with example?
74. Explain the function without return type and return value with example?
75. Explain the function without return type and without return value with example?
76. Explain the void type in C ?
77. Explain Nested Functions concept? How is it different from Recursive functions?
78. Define a Storage class in C?
79. What are the Storage classes in C?
80. What is extern, auto , static, register? … explain
81. What are the Qualifiers (or qualifier for a datatype)?
82. Define Array? How many types of Arrays ? examples
83. What is the representation, Declaration, Definition of 1-D , 2-D , 3-D arrays ?
84. What are the Applications of Arrays ?
85. What is a Jagged Array?
86. Define a Pointer?
87. How do u declare a pointer variable ?
88. what is * and & in pointer concept?
89. what is pointer to pointer?
90. Explain the pointers to arrays concept ?
91. Explain the pointers to functions concept?
92. What is the disadvantage of pointers concept in C?
93. What is the Calling function and Called function?
94. What are the Actual parameters /arguments and Formal parameters/arguments?
95. Explain the concept of pass by value / call by value?
96. Explain the concept of pass by reference / call by reference?
97. What are the types of memory allocation?
98. What is static allocation and dynamic allocation?
99. What is the difference between the static allocation and compile time allocation?
100. What are the dynamic memory management functions in C?
101. What is syntax for malloc() , calloc(), realloc() and free() functions ?
102. Define a string ? what are the string manipulation functions in C? Explain each with an example?
103. What are Command line arguments in C?
104. what is main(argc, *argv []) ?
105. What is arrays of strings ?
106. What are the Derived datatypes in C?
107. Define Structure ? How do u declare and initialize a structure variable?
108. Can u initialize a structure within the main() function ?
109. how do u access a structure variable?
110. Explain the concept of nested structures with example?
111. Explain the concept of arrays of structures and arrays within structures with an example?
112. what is pointers to structures?
113. What is self-referential structure?
114. Define Union in C?
115. Is there any difference between Structure and Union ?
116. what is the use of typedef ?
117. Explain the concept of bitfields in C?
118. What is a enumerated datatype in C?
119. Define a FILE ? what is a file descriptor, what are the values for it ?
120. What are the File I/O functions ?
121. What is a stream? What is Input stream and Output stream?
122. What are the standard I/O functions in files?
123. What are the formatted I/O functions in files?
124. What are the File status functions?
125. What is a text file?
126. What is a binary file?
127. Distinguish between a text file and binary file?
128. Define a Data structure ?
129. What are classification of Data structures?
130. Define sorting ?
131. What are the various sorting techniques?
132. What are the Internal and External sorting techniques?
133. What is Time Complexity?
134. What is Space Complexity?
135. What are the notations for Time and Space Complexities?
136. Explain the Bubble / exchange sort procedure? Complexity?
137. Explain Quick / Partition Exchange sort procedure? Complexity?
138. Explain Insertion / In-place sort procedure? Complexity?
139. Explain Selection sort procedure ? Complexity?
140. Explain Merge sort / External sort procedure ? Complexity?
141. Which is the Best sorting technique and Why?
142. Define Searching?
143. What are the various Searching techniques?
144. Explain the Sequential / Linear search procedure ? Complexity?
145. Explain the Binary search procedure ? Complexity?
146. Define an ADT? Give an Example.
147. What is a Stack ADT? What are the operations on stacks ? What are the applications ?
148. What is a Queue? What are the operations on queues ? What are the applications ?
149. What is a linked list? What are the operations on linked lists ? What are the applications ?
150. What is infix notation , prefix notation, postfix notation of an expression , explain with examples and conversions from infix to postfix .
151. Source code for:
• Palindrome
• Armstrong
• Fibonacci sequence (recursive and non-recursive)
• Factorial
• Prime number
• Even / Odd
• Roots of a Quadratic equation
• Swapping two numbers without using a temporary variable
• Program to reverse a string
• Logic for multiplication of matrices

CDS (UNIT-3) FREQUENTLY ASKED QUESTIONS

1. (a) What is a Preprocessor directive?
(b) Distinguish between function and Preprocessor directive?
(c) What is the significance of Conditional Compilation?
(d) How does the undefining of a pre-defined macro done?

2. (a) Write a program to demonstrate passing an array argument to a function? Consider the problem of finding largest of N numbers defined in an array.
(b) Write a recursive function power(base, exponent) that when invoked returns base exponent?

3. What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values?

4. (a) Distinguish between the following.
(i) Actual and Formal arguments?
(ii) Global and Local variables?
(iii) Automatic and Static variables?
(b) Explain in detail about pass by value and pass by reference. Explain with a sample program?

5. (a) Distinguish between formal variable and actual variable.
(b) Distinguish between Local and Global variable.
(c) Distinguish between Call by value and Call by reference.

6. (a) What is the syntax followed in the definition of a macro?
(b) What are the advantages and disadvantages of macros?
(c) What is meant by conditional compilation? What are its advantages?

7. (a) What are the advantages and disadvantages of recursion?
(b) Write a C program to find the factors of a given integer using a function.

8. (a) Give some important points while using return statement.
(b) Write short notes on scope of a variable.

9. (a) Write short notes on auto and static storage classes.
(b) Write short notes on call by reference.

10. (a) Distinguish between user defined and built-in functions.
(b) What is meant by function prototype? Give an example for function prototype.

11. (a) Distinguish between getchar and scanf functions for reading strings.
(b) Write a program to count the number of words, lines and characters in a text.

12. (a) What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values.
(b) Write a C program that uses a function to sort an array of integers.

13. Define an array. What are the different types of arrays? Explain

14. (a) Write a C program to do matrix multiplications.
(b) Write in detail about one dimensional and multidimensional arrays. Also write about how initial values can be specified for each type of array.

CDS (Unit-2) Frequently asked questions

1. Write the various steps involved in executing a C program and illustrate with the help of flow chart?
2. What is the difference between break and continue statements ? Explain with examples.
3. What is the purpose of goto statement? How is the associated target statement identified?
4.(a) What are constants?
(b) Name the different data types that C supports and explain them in detail.
5. (a) What is meant by looping? Describe any two different forms of looping with Examples.
(b) Write a program to print the following outputs using for loop.
i) 1
2 3
4 5 6
7 8 9 10

ii)1
2 2
3 3 3
4 4 4 4
6. What are the logical operators used in C and illustrate with examples?
7. Whar is the purpose of switch statement ? How does this statement differ from the other statements?
8. (a) What is an Expression ? What kind of information is represented by an Expression?
(b) What is an Operator? Describe several different types of operators that are included within the C language with an example each?
9. What are the different types of control statements available in C. Explain them with an example.
10. (a) What is the difference between signed integer and unsigned integer in terms of memory and range?
(b) Explain the basic structure of C program?
11. Explain the following and illustrate it with an example?
(a) Increment and Decrement Operator
(b) Conditional Operator
(c) Bitwise Operator
(d) Assignment operator
12. State the rules that are applied while evaluating expression in automatic type conversion?
13. (a) What is a String constant? How do string constants differ from character constants? Do string constants represent numerical values?
(b) Summarize the standard escape sequences in C? Describe them.
(c) What is a variable. How can variables be characterized? Give the rules for
variable declaration.
(d) What is a purpose of type declarations? What are the components of type declaration?
14.Write a program to determine and print the sum of the following harmonic
series for a given value of n: 1+1/2+1/3+1/4+…..+1/n.