Вы находитесь на странице: 1из 4

C Questions

Introduction
1. What are the features of C?
2. Define Constant in ‘C’. How is it classified? What is symbolic constant? Explain.
3. Describe the characteristics and purposes of escape sequence characters.
4. What are trigraph characters? How are they useful?
5. What are the General characteristics of C?
6. Define Operator and Expression in C.
7. Describe any five operators in C with suitable example.
8. Explain file inclusion directives in ‘C’.
9. What are the input and output statements in C? Explain their syntax and example.
10. What are character sets? Explain.
11. Give the basic structure of a C program and explain each part in detail.
12. Describe in brief C token.
13. What are enumeration variables? How are they declared? What is the advantage of using
them in a program?
14. What is escape sequence? What is its purpose?
15. Explain Pre-processor in C. Explain the scope and advantages of a preprocessor directive
within a program file?
16. Describe the limitations of using getchar and scanf functions for reading strings.
17. Explain how variables and symbolic name differ. / State the differences between the
declaration of a variable and the definition of a symbolic name.
18. Distinguish between ‘global and extern’ variables with the help of suitable examples.
19. Describe the purpose of the qualifiers const and volatile.
20. Define datatypes. Describe various datatypes with suitable example.
21. Discuss various operators involved in comparison and logical decision in C. Explain with
suitable example.
22. What is Bitwise operator? Discuss in detail the various bitwise operators involved in Bitwise
operators with suitable example.
23. What is execution character? What is its purpose?
24. Explain the constants and variables in C. What are reserved word(keyword)? Explain.
25. Discuss the various operators involved in comparison and logical decision making in C.
Demonstrate by giving suitable example.
26. Explain the syntactic rules governing printf() and scanf() with suitable example.
27. What do you mean by conditional expression? What is the difference between the two
operators ‘=” and ‘ = =’?
28. What is the use of comma operator and ternary operator? Explain with suitable example.
29. Give the summary of C operators with their precedence and associatively in the following
format.
Operator Description Associatively Rank

Control Statements :
30. What is meant by branching? What is the purpose of “If-else” statement?
31. Describe with their syntax different forms of “If-else” statement. How do they differ?
32. Explain the concept of if statement with all structures.
33. Explain the syntax and difference between while and do-while statements with an example.
How do break and continue statements work in while loop? Elaborate with an example.
34. What is the purpose of while statement? How does it differ from the Do-while statement?
Explain with a suitable example.
35. What is the purpose of ‘break’ and ‘continue’ statement in C program? Explain with their
syntax and suitable example.
36. Explain the following loop control statement in C (i) break (ii) continue (iii) goto. How is
break statement involved in constructing a multiway switch-case statement?
37. Write syntax of switch statement.
38. Explain do-while statement with syntax and example.
39. What are control statements used in C? Explain with the help of suitable examples.
40. What are decision making statements?
41. Explain unconditional control statement. Write a program in ‘C’ to demonstrate the use of
unconditional control statement.
42. Explain the conditional statements used in C with the help of suitable example. Write a
program to find roots of quadratic equation ax2+bx+c = 0. Check the conditions for equal,
unequal and imaginary roots.
43. What is switch-case statement? How the do while loop varies from the while loop? Explain
with suitable example. What are nested for loops? Explain.

String Handling
44. Write a program in C which will read a string and rewrite it in the alphabetical order. For
example, the word STRING should be written as GNIRST.
45. What is the purpose of the getchar function?
46. Write the syntax and usage of strcmp() and strcat() function in C.
47. Write the syntax and usage of strcpy() and strlen() functions in C.
48. Character strings in C are automatically terminated by the null character. Explain how this
feature helps in string manipulations.
49. What is string? Explain the four string functions in C with an example. Write a program in C
which reads your name from the keyboard and outputs a list of ASCII codes which represents
your name.

Functions :
50. What is function? What are the advantages of function? What is the purpose ‘return’
statement and keyword ‘void’? Explain with suitable example.
51. Explain user defined function with its need and syntax.
52. What is recursion? What are the purposes? State their advantages. How is a recursive
function differing from ordinary function? Write a program in ‘C’ to find the factorial of a
given number ‘n’ by using Recursion.
53. Distinguish between ‘Actual and Formal’ arguments with the help of suitable examples.
54. Explain the difference between ‘call by value’ and ‘call by reference’.
55. Write a note on the scope and life time of variables in functions.
56. Main is a user defined function. How does it differ from other user-defined functions?
57. What is function prototype? What is their purpose? Write a program in C by using function
prototype to find the real roots of quadratic equation.
58. How is a function declared in C? Explain with example.

2
Array :
59. What is an array? Explain need of an array. How are one dimensional and two dimensional
arrays stored in memory? How to declare and initialize them?
60. Define ‘storage class’ of a variable and state its purposes. What is the basic structure of C
function?
61. What are subscripts? How are they written? How does an array definition differ from that of
an ordinary variable?
62. How 1-D and 2-D array stored in memory? How to declare and initialize them? Explain with
example.
63. Explain passing arrays to the function with the program for finding largest number form an
array.
64. State the rules used to declare one dimensional arrays. Write a program to read a 2-D square
matrix ‘A’ and display its transpose.

Structure :
65. What is structure? Explain ‘structure within structure’ with suitable example. Define typedef
with suitable example/
66. What is structure? How does it differ from an array? How is structure declared and initialize?
67. What is union? Explain how union differs from a structure.
68. Define a structure for a ‘student’ which includes the name, class, roll number and total marks
out of 500. Perform following operations on the above structure.
a. To print students name according to the class.
b. To print students name with the total marks greater than 350.
69. Define a structure that can describe a hotel. It should have members that include name,
address, grade, average room charge, and number of rooms. Write functions to perform
following operations :
a. To print out hotels of given grade in order of charges.
b. To print out hotels with room charges less than Rs. 400/-.
70. Describe structure in brief and write a simple program to illustrate the method of sending an
entire structure as a parameter to a function.
71. Define a structure called cricket that will describe the following information: player name,
team name, batting average. Using cricket, declare an array player with 50 elements and
write a program to read the information about all the 50 players and print a team-wise list
containing names of players with their batting average.
72. Describe structure in brief and write a program in C to illustrate the method of sending an
entire structure as a parameter to a function.
73. What is the purpose of the typedef feature? How is this feature used in conjunction with
structures?
74. Differentiate between union and structure.
75. Describe in detail dynamic memory allocation with its functions.
76. Explain arrays within structure with an example.
77. What is meant by the following terms :
a. Nested structure
b. Arrays of structure

3
Pointer :
78. What is pointer? Explain its advantages. How is a pointer declared?
79. What is a pointer? What is the use of pointer in C? how pointer variable differ from an
ordinary variable? Write a program in C using pointer, to read the elements of array and print
its elements in reverse order.
80. What is “call by value” and “call by reference”? Explain with suitable example.
81. Explain command line arguments with an example. What are the advantages of using them?
82. How is a structure-type pointer variable declared? Explain with suitable example.
83. Write in short about declaring and initializing pointers in C.
84. Write a program in C to print the address of variable along with its value.
85. Distinguish between (*m)[5] and *m[5];

File I/O :
86. Describe in brief fopen function and file opening mode.
87. Describe in brief fopen() and fclose() function and its file opening modes.
88. Explain the various functions involved in opening and closing a file in ‘C’. Demonstrate by
writing a program in C.
89. What is buffer area? Discuss its uses when working with stream oriented data file.
90. What is stream pointer? Explain with suitable example.
91. Discuss in brief command line parameters (arguments) argc and argv with suitable example.
What are the advantages of using them.
92. What is stream pointer? What is the relationship between a stream pointer and a buffer area?
93. What are various modes of opening a data file?
94. A file name ‘MCM’ contains a series of integer numbers. Read this file and write even
numbers to a file named ‘even’ and odd numbers to the file named ‘odd’ file.
95. A file named DATA contains a series of integer numbers. Code a program in C to read these
numbers and then write all odd numbers to a file to be called ODD and all even numbers to a
file to be called EVEN.
96. Explain the following functions with syntax and suitable example :
(a) fread (b) fwrite (c) fscanf (d) fprintf (e) fclose
97. Explain Error handling during I/O operations.
98. What are the different statements used for file handling? Explain with syntax and suitable
example.
99. Explain rewind(), fsek() and ftell() functions in C.
100. Distinguish between the following functions with suitable example
a. getc and getchar
b. printf and fprintf

C

Вам также может понравиться