// Anna University, Chennai / 2024
Anna University — Programming in C (CS3251), November/December 2024
Programming in C · CS3251 · R2021 · B.E./B.Tech. Engineering (common paper)
Files open in a new tab. Use your browser's download or save option to keep a copy.
Work through the questions
15 questions
No verified answers are available for this paper.
Write any two applications of C.
No verified answer or solution is available for this question.
Differentiate while and do-while statements.
No verified answer or solution is available for this question.
If string 1 is "C Programming" and string 2 is "Language", write the built-in functions to: (a) Find the length of string 1. (b) Compare the two strings to check whether they are equal.
No verified answer or solution is available for this question.
What happens if a C program assigns a value to an array element whose subscript exceeds the size of the array?
No verified answer or solution is available for this question.
What is the output of the following program? #include <stdio.h> void fun(int *ptr) { *ptr = 30; } int main() { int y = 20; fun(&y); printf("%d", y); return 0; }
No verified answer or solution is available for this question.
List any two built-in math functions.
No verified answer or solution is available for this question.
What are self-referential structures?
No verified answer or solution is available for this question.
Write the syntax for dynamic memory allocation.
No verified answer or solution is available for this question.
Differentiate between sequential and random access.
No verified answer or solution is available for this question.
What do fscanf() and fprintf() do?
No verified answer or solution is available for this question.
(a) (i) Write a C program to check whether a person is eligible to vote using if/else. (8 marks) (ii) Write a C program to print a student's grade using a switch statement. (8 marks) (OR) (b) (i) Write the structure of a C program. (8 marks) (ii) Explain preprocessor directives in C. (8 marks)
No verified answer or solution is available for this question.
(a) Write a program using an array to read and display information about an employee and calculate the employee's payroll. (OR) (b) (i) Write a C program to perform matrix multiplication. (8 marks) (ii) Write a C program to sort the following numbers using selection sort: 45, 6, 89, 3, 4, 56, 10. (8 marks)
No verified answer or solution is available for this question.
(a) (i) Write a C program to generate the Fibonacci series recursively. (8 marks) (ii) Compare pass by value and pass by reference with an example. (8 marks) (OR) (b) (i) Write a C program to check whether a string is a palindrome. (8 marks) (ii) Write a C program to count vowels and consonants in a string using a pointer. (8 marks)
No verified answer or solution is available for this question.
(a) A record holds inpatient information such as pname, Address, PID and Admission_Date. Create a structure to store inpatient records. Write a C program to: (i) Insert a new patient into the system. (8 marks) (ii) Print all inpatient details according to Admission_Date. (8 marks) (OR) (b) (i) Explain the various operations on a singly linked list. (8 marks) (ii) Write a short note on structures. (8 marks)
No verified answer or solution is available for this question.
(a) Write a C program to copy the contents of one file to another. (16 marks) (OR) (b) List the various types of file processing and explain any two. (16 marks)
No verified answer or solution is available for this question.