Important Questions of C Programming | C Programming Important Questions

1. Draw the basic structure of a C program.

2. State the series of steps for executing a program written in C.

3. What is compiler?

4. What is header file in C? List any two header files.

5. What are library functions? Give example.

6. What is the significance of stdio.h?

7. What is the difference between “stdio.h” and “string.h” ? Explain.

8. What is the purpose of scanf() function?

9. What is the difference between scanf() and gets().

10. What is keyword in C?

11. What is the use of %d in C?

12. What is the use of \t in C?

13. Mention how to write a comment in C?

14. What is source code?

15. What is data type?

16. What is a variable? State the rules of declaring a variable.

17. Define variable. Give example.

18. Write how a variable can be declared in C.

19. What is global variable?

20. Differentiate between local variable and global variable.

21. Define constant in C or define C constant.

22. What is string constant? How string constant is differ from character constant.

23. What is the difference between variable and constant?

24. Explain data type.

25. Write the difference between C character and C string.

26. What does data type of a variable signify?

27. What are the basic data types available in C?

28. Describe the four basic data types in C.

29. What is the size of int?

30. How many bytes are occupied by long int?

31. How many bytes of memory occupied by a variable declared as float?

32. How does type float differ from double in C language?

33. Why floating point numbers are not used for equality in expressions?

34. What is the use of unsigned char?

35. What is a null string?

36. Write the use of null character.

37. What is the use of “\n”?

38. What is an operator?

39. Briefly explain the increment and decrement operators.

40. How does x++ differ from ++x?

41. State the difference between “=” and “==” operator explain with example.

42. Briefly explain about C operators with example.

43. Write two relational operator and two logical operator.

44. What is the difference between Relational operator and Logical operator? Explain.

45. What do you mean by unary operators? Briefly explain the assignment operator, arithmetic operators and logical operators.

46. Explain the function of conditional operator?

47. If a= -11 and b= -3, what is the value of a%b?

48. What are the different types of Input/Output functions of C language? Explain them.

49. Explain the concept of control structure in C. Give example.

50. What is use of if statement?

51. Explain in brief the nested if statement.

52. What is a flowchart?

53. Define flowchart?

54. Draw the flowchart for maximum of two numbers.

55. Explain switch statement.

56. Define switch in C. Write a program using switch.

57. Write the syntax of switch-case statement.

58. Explain switch case statement with an example.

59. What is the use of break keyword?

60. What is the use of break statement?

61. What is the use of continue statement. Give example

62. Differentiate between break and continue.

63. What is the use of goto statement?

64. Write the use of continue statement.

65. What do you mean by looping? Explain the types of loop with syntax.

66. Write two advantages of using loops. Describe the syntax of the ‘for’ loop.

67. Write the difference between while and do while loop.

68. Differentiate between while and do-while loop construct.

69. Define array. How array is initialized in C?

70. What is array? Why are arrays needed?

71. What is an array? How an array is declared?

72. How an array of 10 integers declared and used in C.

73. Define array. How two-dimensional array is initialize?

74. Differentiate between one dimensional array and two dimensional arrays.

75. Explain the stages in array initialization.

76. What are the conditions that must be satisfied by all the elements of any given array?

77. What is structure? Explain the syntax of structure declaration with example.

78. What is the advantage of using structure in C program?

79. What is “sizeof” operator?

80. What are the different storage classes of C?

81. Distinguish between auto and register storage class.

82. Explain storage classes in brief.

83. How many types of storage classes does C supports? what is the necessity of each

84. What is a static variable in C?

85. What is a register variable in C?

86. Explain the scope of a variable in C.

87. What is a flowchart?

88. Draw the flowchart for maximum of two numbers.

89. Why do we use #define in our program.

90. What is a pointer variable? State the advantages of using pointer variable.

91. What are the pointers? How to use pointers?

92. What is a pointer? Give examples.

93. What is pointer in C? How is a pointer initialized?

94. What is the difference between a and *a?

95. Write the advantage of using pointers.

96. What is function? What are the advantages of using function?

97. Write name of two string functions.

98. Write name of two math functions.

99. Write the use of strcpy() function. Give example.

100. Write the use of strlen () function.

101. Describe the use of strlen() function with the help of an example.

102. Explain the use of strcat function with example.

103. Explain any three string functions in C.

104. Write any two string functions with their actions.

105. State any two string functions with their actions.

106. Write down the advantages of function.

107. Explain the concept and use of type void.

108. Define void. When void is used in function?

109. What are the major components of a function definition? Give example.

110. What is a formal parameter and actual parameter?

111. What is formal argument and actual argument?

112. What is formal argument and actual argument in a C function? Explain with example.

113. What is call by value and call by reference?

114. Differentiate between call by value and call by reference.

115. What is meant by call by value? Explain how it is different from call by reference. Write C language program to support your answer.

116. What is call by reference? Write a C program to swap two numbers using call by reference.

117. Explain in brief the concept of recursion. Give example.

118. What is recursion? Write a C program to explain the benefits of using recursion.

119. What is a recursive function? Explain with the help of an example.

120. Explain the concept of recursive functions with an example.

121. Explain the working principle of a recursive function with an example.

122. What is the use of exit()?

123. Write briefly about file handling in C language.

124. What is append mode in file?

125. Explain how the file open and file close functions handled in C.

126. What is a file? Explain how the file open and file close functions.

127. Write the use of fprintf() and fscanf().

 

128. Explain the following statements:

        a. break

        b. goto

        c. switch case

        d. if-else

 

129. Briefly explain:

        a) Data types in C

        b) Return statement

        c) Variables

 

130. Differentiate between the followings:

        a) Built-in function and User defined function

        b) Call by value and Call by reference

        c) while and do…while loop

        d) If-else and switch case

        e) Break and exit

        f)  Nesting and Looping

        g) Variable and identifier

        h) C character and C string

        i)  Break and Continue statement

        j)  Increment and decrement operators

        k) getchar() and getch()

 

131. Write short notes on the following:

        a)  Pre increment and post increment

        b)  If-else and switch statement

        c)  For loop and while loop

 

132. Write a program in C to find the average of three numbers.

133. Write a C program to find the sum and average of N numbers.

134. Write a C program to find the sum of the digits of a given integer.

135. Write a C program to find the largest of three numbers.

136. Write a C program to find the greatest number among three numbers.

137. Write a C program to find the maximum of three numbers using conditional operator.

138. Write a C program to find biggest of given three number using nested if.

139. Write a program in C to check whether a number is even or odd.

140. Write a C program to find out if the given year is a leap year or not.

141. Write a program in C to swap two numbers using third variable.

142. Write a program to swap two numbers without using third variable.

143. Write a C program to swap two integer values using function.

144. Write a C program to create a calculator using switch case.

145. Write a program in C to display the largest and smallest element in an integer array.

146. Write a program in C to check whether a number is divisible by 6 or not.

147. Write a program in C to print the number from 1 to 100.

148. Write a C program to find the sum of digits in a given number.

149. Write a C program to calculate the sum of 4 digit numbers.

150. Write a C program to display all even numbers between 10 and 150.

151. Write a C program to check whether a number is prime or not.

152. Write a C program to find the biggest number in an array.

153. Write a C program to find the largest of n numbers using array.

154. Write a C program to find the sum of the elements of an array.

155. Write a program in C to find the sum of given n integers using an array.

156. Write a C program to display first 20 multiple of 11.

157. Write a C program to check whether an alphabet is vowel or not using switch case.

158. Write a C program to display all the numbers which are both divisible by 3 and 4 within the range 300 and 400.

159. Write a C program to subtract two matrices.

160. Write a C program to find sum and average of a list of numbers.

161. Write a C program to add two matrices.

162. Write a C program to multiply two matrices.

163. Write a C program to copy a string into another string using strcpy functions.

164. Write a C program to find the factorial of a given number.

165. Write a program in C to enter emp_id, emp_name and salary of three employees and display the records using structure.

166. Write a C program to define name, roll-no, class, sex and height for 50 students using structure.

167. Write a C program to find biggest of given n numbers.

168. Write a C program to find the smallest from a list of n numbers.

169. Write a C program to print all the numbers between 1 and 100 which are divisible by 3.

170. Write a C program to generate first 30 integers (positive) that are divisible by 7.

171. Write a C program to generate and print 50 positive integers that are divisible by 7.

172. Write a C program to generate the first 50 positive integers that are divisible by 7.

173. Write a C program to print the multiplication table from 1 to 10 with proper formatting.

174. Write a C program to find whether a number is divisible by two or not using functions.

175. Write a C program to print the following series:

1  1  2  3  5  8

176. Write a C program to evaluate the series 1+ 1/3+ 1/5+… upto 5 terms.

177. Write a C program to find the sum of the  following series:

S=1+ ½ + 1/3 + 1/4 …… +1/n

178. Write a C program to evaluate the following series:

S=1+ ½ + 1/3 + … +1/N

179. Write a C program to find and print transpose of a given matrix.

180. Write a C program to find arithmetic  mean of n numbers using a function.

181. Write a C program to generate the following: 


1

1  2

1  2  3

 

182. Write a C program to print the following pattern:

1

1  2

1  2  3

1  2  3  4

1  2  3  4  5

 

183. Write a C program to reverse a given integer.

184. Write a C program to print the reverse of a given number.

185. Write a C program to display all numbers between 200 and 500 which are divisible by 17.

186. Write a C programe to calculate the sum of a 3 digit number.

187. Write a C program to find the sum of N numbers.

188. Write a C program to reverse an integer value using function.

189. Write a c program to add two numbers using a function call.

190. Write a C program to add two matrices of order M X N.

191. Write a C program to define and use a student structure with following data members:

rno, name, marks

192. Write a C program to check if a given string is a palindrome string or not.

193. Write a program to check whether a string is palindrome or not.

194. What would be the output of the following program?

sum=0;

for(i=-100; i<0; i++)

sum+=abs(i);

printf(“%d”,sum);

 

195. Write a C program to create the following structure.

Structure name: country

Data members: serial number, state, capital.

Enter the data into the structure and then display the data using structure.

 

196. Write a C program to find sum of two values using pointer.

197. Write a C program to add two integers using pointers.

198. Write a C program to add two numbers using pointer variable.

199. Write a C program to find biggest of two given numbers using pointers.

200. Write a C program read a text file and print the output.

201. Write a C program to find the sum of numbers between 1 and n.

 

 

Fill in the blanks:


1. The logical operator = = checks for ______ of two values.

2. The expression 11%3 evaluates to ______.

3. An array always contains data of ____ type.

4. In C while is _________ word.

5. Array elements can be accessed _______

6. exit(0) in a C program represents_______

7. The _____ statement is used to skip statement in a loop.

 

 State True or False for the following:


1. No two case labels can have the same value.

2. 12,245 is a legal string constant in ‘C’.

3. If int a=10, the expression a+4/6*6/2 evaluates to 11.

4. Elements of structure have to be of the same type.

5. strcmp function returns an integer value.

6. A char variable occupies 2 bytes in memory.

7. m++ can also be written a m+=1.

8. If int a=10, the expression a+4/6*6/2 evaluates to 11.

9. A function cannot be defined inside another function.

 

 

Post a Comment

0 Comments