Sri Muthukumaran Institute of Technology
Chikkarayapuram, Near Mangadu, Chennai – 600 069.
Academic Year 2024-2025 / Even Semester
Programming in c CS3251
Question Bank
1.Distinguish between while and do while statements in C
2.Define programming paradigm.
3. What is the output of the below program?
#include <stdio.h>main()
int a = 20, b = 10, c = 15, d = 5; int e;
e = (a + b) * c / d;
printf("Value of (a + b) * c / d is : %d\n", e );
4.Define structure in C
5.Write the syntax for fgets() and fopen() function
6. Define float array of size 5 and assign 5values to it.
7. Define conditional operator. Also write the syntax for the same
8. Write a program to find factorial of the number
9. What is dangling pointer
10. What is the use of ‘\0’ and ‘%s’?
11. What will happen when you access the array more than its
dimension?
12, Write the syntax for fgets() and fopen() function
13. Why is scope of variable necessary in function?
14, Invent the meaning of blocks cope in scope of variables.
15. How the members of structure object is accessed?
16. List out the different access mode of operations on file
17. How to access structure members using structure pointer variable
18. Define storage class specifier.
19. How the string is passed to function?
20. How will you explain preprocessor in C ?
21.Write a C program to calculate median for an array of
elements.
22. Explain the need for array variables. Describe the following with
respect to arrays. Declaration of array and accessing an array element.
23. C program to find whether the given string is palindrome or not
without using string functions.
Compare and contrast gets()and puts().
24.Explain in detail about data types and its types with one simple program.
25.Explain about various looping statements available in c with one sample
program
26.Write a C program to implement matrix multiplication with output.
27. Write a C program to find square root of a number.
28.Write a short note on Array, Array declaration and Array Initialization.
Also explain the features and processing an array
29.What is function prototype? Also mention its types and explain the same
with example program for each type.
30.Write a C program to evaluate DA,TA,Tax,Gross Pay and Net pay of three
employee details using pointers and structures with output.
Note:DA=67% of Basic pay
TA=20% of Basic Pay
Tax=12% of Basic Pay
Gross Pay = Basic Pay+DA+TA
Net Pay =Gross Pay-Tax
31.Describethefollowingwith suitableexamples.
(i) Initializinga2DimensionalArray(7).
(ii) MemoryMap of aDimensional Array.(6).
32.(i).WriteaCprogramtosortthennumbersusingselection sort.(7)
(ii).Illustrate with an example of command line arguments.
33.(i).Develop a C program for binary search using recursive
function. (ii).IllustrateaCprogramforcubeofanumberusingpass by
Reference.
34.(i).Examine with example program for different types of user
defined function .
(ii).Illustrate a C program for cube of a number using pass by
reference..
35. Write a C program to read the details of book name, author name
and price of 200 books in a library and display the total cost of the
books and the book details whose price is above Rs.500.
(ii). Explain with an example the self-referential structure.
36.(i).How to access enumerated datatype and explain with an
example program.
(ii). Referencing pointer to another address to access the memory.
37. a.(i).How to access enumerated datatype and explain with an
example program.
(ii). Referencing pointer to another address to access the memory
b.(i).Define a structure called student that would contain name, regno
and marks of five subjects and percentage. Write a program to read
the details of name, regno and marks of five subjects for 30 students,
calculate the percentage and display the name, regno, marks of the
subjects and percentage of each student.
(ii).Examine the differences between nestedstructures and
arrayofstructures.
38.(i). Examine with example program for different types of user
defined functions .
(ii). Write a C program to find average marks obtained by a of 30
students in a test.
b.Develop a C program for the following:
(i)To check whether a number is prime or not.
(ii).To convert the temperature given in Fahrenheit to Celsius and
vice versa.
39. Write a short note on structure variable declaration, initialization,
accessing variable and structure and array.
40. Define linked list? Write a C program to create Linked list and to do
insertion and deletion operation on the created list
41. List out the different file operations and its syntax with an example.
42. Write a C program to merge the contents of two files.
43.. Define command line arguments. Discuss it with example.
44. Define Dynamic Memory Allocation. Also list out and explain the types of
dynamic memory allocation.
45.List out and explain in detail about parameter passing methods with
swapping of 2 numbers program as example for each.