CS3251-Programming in C-Question Bank
CS3251-Programming in C-Question Bank
PART-B
1. Differentiate between signed and unsigned integer. JAN 10, MAY 12.
2. Explain the Structure of a c program.What is the advantages & applications of c language? JAN 11,
NOV/DEC 19
3. Explain the different data types in C with Example. JAN 13, MAY-09,10, 16
4. What is meant by operator Precedence? Discuss its impact in the programming with suitable example.
JAN 09
5. Describe various types of operators in by C. Discuss each of them with suitable examples JAN 11,13,
NOV 14,15 ,MAY 11, 15, 16, NOV 17, APRIL/MAY 18, NOV/DEC 19
6. (i) Differentiate between operand and operator with an example.
(ii) Discuss about bitwise operator and logical operators in C JAN 13
7. Write a C program for the following expression JAN 10
(i) a=5<=8 &&6!=5
(ii) a=b++ ++b where b=50
8. Explain with an example formatted and unformatted I/O statements. JAN 12, MAY 10, 16
9. Explain various decision making structures with illustrative examples. JAN 13, MAY-09,10, NOV 15,
NOV 17 or Describe the decision making statements in C with an Example. APRIL/MAY 18,
NOV/DEC 19
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
10. Explain about Branching and looping with example. JAN 11, MAY 11,12,14, NOV 17, APRIL/MAY
18, APRIL/MAY 19, NOV/DEC 19
11. Explain in detail about managing input and output operators. JAN 11
12. Explain any four format strings with an example. JAN 13
13. Explain the program control structures with suitable examples JAN 09, NOV 17
14. How does a switch statement differ from if statement? Explain with an example. JAN 09, NOV/DEC21
15. Explain the following conditional statements JAN 10, 11
(i) If-else statement
(ii) Nested If-else statement
(iii) Switch statement JAN 13, MAY-09,10
16. Write a c program to determine the given number is odd or not using If-else statement. JAN 11
17. Explain the various syntaxes for performing the branch and looping process. JAN 12
18. (i)Explain any four format string with examples. JAN 13
(ii)Write the syntax of “for construct” in c. Give an example. JAN 13
19. Writ a c program to display a pyramid structure using numbers. MAY 12
20. Write a c program that reads a character and display only vowels using Switch case structure. MAY 12
21. Write a C program that Computes and prints a table of Factorial for a given Integer. MAY 10
22. Write a C program to check given number is a prime number or not. JAN 10, June 14
23. (i)Write a C program to print the Fibonacci series of a given number. JAN 09
24. (i)Write a C program to find number of vowels in a string
25. (ii)Write a C program to find number of sentences, words and characters in a given paragraph. JAN 13,
MAY-09,10
26. Write a C program to explain about ternary operator.
27. Write a C program to find the factorial of the given number.
28. Write a C program swap 2 numbers without using third variable.
29. Write a C program to display the sum of n numbers. MAY 09,10 or Write a C program to print sum of
10 non negative numbers entered by the users. APRIL/MAY 19
30. Write a C program to to find the largest among 3 numbers entered by the user. APRIL/MAY 19
31. Explain about increment and decrement operator with an example.
32. Write a C program to find the area of circle and to solve quadratic equation. MAY 14
33. Write a C program to reverse a string without using string reverse function. MAY 09,10
34. Write a C program to check whether the given number is Armstrong number or not. JAN 10
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
35. Explain the various looping constructs. Give an example for each and explain the working of the
construct.JAN 09, NOV 14 , MAY 15
36. What are constants? Explain the various types of constants in C. MAY 15
37. Write a C program to solve the quadratic equation. MAY 15
38. Write a C program for the following series: 1+2+3+4+………+n. MAY 16
39. Write a C program to check the integer is Palindrome or not. APRIL/MAY 18
40. (i) Explain iterative statement in ‘C’ with an example. (8) NOV/DEC 21
(ii) Discuss pre-processor directives with example program. (8) NOV/DEC 21
41. i. Explain enumeration constants with an example program. NOV/DEC 21
ii. Write a ‘C’ program to compute student grades using switch case statement. The input to be
program are marks of 5 subjects, compute the total and average and find respective grade of
the students. NOV/DEC 21
Grades>90 ‘S’ 80-90 A 70-79 B 60-69 C 50-59 D 40-49 E <40 F
42. Explain various operators in C Language in detail. NOV/DEC 21
43. Explain various input and output functions of C language in detail. NOV/DEC 21
PART-A
1. Define array/what is an array JAN 14, MAY 15,16
2. How to declare an array?
3. What are the types of arrays?
4. What are the main elements of an array declaration?
5. How to initialize an array?
6. Why is it necessary to give the size of an array in an array declaration
7. What is the difference between an array and pointer?
8. Differentiate one dimension array and two dimension array.
9. Declare a character array of size 5 and assign vowels to it NOV 15
10. Explain two dimension arrays? JAN 11
11. Write the syntax for initializing a one dimension array and two dimension arrays?
12. Write the syntax for accessing single dimensional array and dimension arrays?
13. Write example code to declare two dimension arrays. June 14
14. Define multi dimension arrays.
15. Write any four features of array JAN 13, NOV 17
16. What is meant by character array?
17. What are the advantages and disadvantages of an array?
18. Define string. Give examples. MAY 16
19. How string variables are declared?
20. How strings are represented in C language JAN 10
21. Give some examples of string functions.NOV 15
22. What are the string manipulation functions?
23. List any four string handling functions? MAY 14
24. What is the use of atoi() function?
25. What is the use of ‘typedef’’?
26. Name any two library functions used for string handling JAN 14
27. What is the use of strlen (), strcpy(), strcat(), strcmp(), strrev(),strstr().
28. What is meant by string concatenation?
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
29. How string comparison is done?
30. Define insertion sort.
31. Explain selection sort.
32. Define Searching?
33. What is linear search and binary search?
34. Give an example for initialization of string array. NOV 14
35. How is a character string declared? Apr/MAY 15
36. Differentiate between Linear search and Binary search. NOV 17
37. What is an array? Apr/May 2018
38. Design a C program compare any two string. Apr/May 2018
39. Define array. NOV/DEC 19
40. Name any two library functions used for string handling. How is a character string
declared?
NOV/DEC 19
PART-B
1. Define arrays. Explain the array types with an example program for each type.
2. Write a C program to convert the given string from lower case character to upper case character and
upper case character to lower case character. MAY 11
3. Write a C program to find largest and smallest in a matrix MAY 10, NOV 15
4. Write a C program to arrange the numbers in ascending order. June 14
5. Write a C program to count the letters in a sequence of characters. JAN 13
6. Write a C program to count the number of vowels in your name. MAY 16
7. Write a C program to print the given numbers in reverse order.
8. Briefly explain the various strings handling function in C. June 10, MAY 15
9. Write a C program to reverse a given string. MAY 11
10. Write a C program to concatenate two strings. MAY 09
11. Write a C program to check whether the given string is palindrome or not. MAY 16
12. What is meant by selection sort? Explain in detail with an example.
13. Write a C program to sort the given set of numbers in ascending order. JAN 11, 13, NOV 14
14. Write a C program to arrange the given 10 numbers in descending order. MAY 16
15. What is linear search? Write a C program to search an element from an array using linear search
16. What is Binary search? Write a C program to search an element from an array using Binary search?
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
17. Write a C program to find the addition of two matrices. JAN 13, 14
18. Write a C program to subtract two matrices and display the resultant matrix. MAY 14
19. Write a C program to find the multiplication of two matrices. MAY 15, 16, NOV 14, 15, 17
20. Explain the various string operations. Write a C program to find the length of a string without using
built-in function. NOV 14
21. Write a C program to search an element in a given array. NOV 14, MAY 15
22. Write a C program to arrange the given 10 numbers in ascending order. MAY 15, NOV 17
23. What are the different types of string function? Apr/May 2018
24. Write the C program to find the number of Vowels, Consonants, Digits and white space in a string.
Apr/May 2018
25.What is string? Explain about declaration and initialization of string in ‘C’. How strings are
displayed with different formats? Explain with examples. NOV/DEC 21
26.Write a C program to check whether the given matrix is symmetric or not. NOV/DEC 21
27.Explain different string handling functions available in C with example. . NOV/DEC 21
28.Write a C program to access the values of an array of elements using pointer. NOV/DEC
21.
29.Explain the concept of arrays in detail with an example program. NOV/DEC 21
30.Write a program in C to (i) Add and (ii) Multiply two given matrices. NOV/DEC 21
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
PART-B
1. Discuss about pointers and their operations that can be performed on it MAY 09, JAN 09
2. What is an array of pointers and what is pointer to an array? Explain in detail with example.
3. Explain in detail about Pass by Value and Pass by reference. DEC 01, 10,11, 12,14,15, MAY 10, 11,16
4. What do you mean by Call by reference? Explain call by Value to exchange values of two variables.
JAN11, MAY 10
5. Explain in detail about function pointers. MAY 09
6. What are the applications of recursive function? JAN 14
7. Explain function Prototyping each with an example.
8. Explain function with arguments and with return type with an example. JAN 09
9. Differentiate Pass by value and pass by reference. JAN 10
10. Write a function using pointers to add two matrices and to return the resultant matrix to the calling
function. MAY 12
11. Write a C program to find the Factorial using recursion. JAN 12
12. What are functions? Explain the types of functions in detail with an example program for each type.
13. What is pointer? When and why they are used? Explain in detail with sample programs. JAN 09, MAY
09
14. Brief call by value and call by reference in detail. MAY 10, NOV 14
15. Discuss about function prototypes in detail.
16. Explain about the different parameter passing methods with examples. JAN 09, NOV 17
17. Write a C Program to print Fibonacci Series using recursion
18. Write a C Program to calculate Area of Circle using Pointer.
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
19. What is recursion? Explain a recursive function with suitable example. Write a iterative and recursive
function to find the power of a number. NOV 14
20. Write a C program to find the factorial of a given number using function. MAY 15
21. Write a C program to exchange the values of two variables using pass by reference. MAY 15, NOV 17
22. Write a C program to find the sum of the digits using recursive function. MAY 15
23. Write a program using pointer to read in an array of integers and print elements in reverse order. MAY
15, NOV 17
24. What is recursion? Explain a recursive function with suitable example. Write a recursive function to
find the factorial of a number. NOV 15
25. Write a C program to count the number of words in a string using pointers. MAY 16
26. Explain the purpose of function Prototyping. Apr/May 2018
27. What is difference between call by value and call by reference in detail.write the coding swapping of
two numbers. Apr/May 2018
28. Explain the following with suitable examples.
(i) Function declaration. (8)
(ii) Call by reference, call by value. (8) NOV/DEC 2021
29. Explain function with and without arguments with example for each. (10) NOV/DEC 2021
What is recursion? Give an example. (6) NOV/DEC 2021
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
PART-B
1. Define Structures. Explain structures in detail. JAN 12,13,14
2. Explain Array of structure in C.
3. How can pass a structure to function in C.
4. How can you insert structure with in another structure?
5. Explain the concept of pointer to structure.
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
6. Define Union. Explain Union in detail. JAN 09
7. What are storage classes? Explain each with example. MAY 15,16
8. Describe in detail about the Preprocessors in C. JAN 11
9. Explain about pre processors with suitable example. MAY 09,16
10. What is enumeration explain with examples.
11. Explain functions and structures. JAN 12,13
12. Explain about structures and its operations. JAN 10,11
13. Explain about pointers to structures, array of structures and nested structures.
14. Write a C program using structures to prepare the students database. MAY 12, NOV 17
15. Write a C program using unions to prepare the employee pay roll of a company.
16. Define Union. Explain Union in detail. JAN 09
17. Define Structures. Explain structures in detail. JAN 09,MAY 09
18. How can pass a structure to function in C.
19. Explain in detail about unions with suitable example.JAN 09, MAY 10,11
20. Write a C Program to accept a string using pointers and functions. JAN 10
21. What are Structures? Create a structure with data members of various types and declare two structure
variables. Write a program to read data into these and print the same. NOV 14,NOV 15
22. Justify the need for structured data type NOV 14
23. Write a C program using Union and Structure to prepare the Library database.
24. Write a C program using Union and Structure to prepare the Patients list.
25. Write a C program using nested structure to prepare the students database.
26. Write a C Program to illustrate an array of structure JAN 10
27. What is union ? Discuss with an example.MAY 15
28. Write short notes on: NOV 15
(i) Union
(ii) Static Storage Class, Register storage class
(iii) #include statement
(iv) #ifndef…#endif
29. Write algorithm and a C program using unions, to prepare the employee pay roll of a company. NOV 17
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
Files – Types of file processing: Sequential access, Random access – Sequential access file -
Random access file - Command line arguments.
PART-A
1. Define File.
2. Specify the various types of file.
3. Describe the various operations performed on a file.
4. Specify the structure of creating a file.
5. How to read the file content.
6. What is the need of file pointer?
7. How to display the file content in the screen?
8. Differentiate sequential and random access file.
9. Why do we need files?
10. Differentiate binary and text file.
PART-B
1. Explain the basic file operations with a neat sketch and suitable program.
2. Explain sequential access file with example program.
3. Explain random access file with example program.
4. Write a program to illustrate command line arguments.
5. Write a program to store and read record of an employee in employee file, where they must be
stored using binary file.
6. Write a program to store and read record of an student in student file, where they must be
stored using binary file.
7. Write a program to store and read record of an customer in bank file, where they must be stored
using binary file.
8. Write a program to read and write a text file using fscanf() and fprintf().
9. Write a program to read and write a binary file using fscanf() and fprintf().