// Anna University, Chennai / 2023
Anna University — Programming in C (CS3251), November/December 2023
Programming in C · CS3251 · R2021 · B.E./B.Tech. Engineering (common paper) · Semester 2
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.
Justify the statement, "Keywords cannot be used as identifiers."
No verified answer or solution is available for this question.
Distinguish while and do-while loops with one example.
No verified answer or solution is available for this question.
Give an example of initializing a two-dimensional array with a set of values.
No verified answer or solution is available for this question.
- 2025
- 2023
Also asked in Anna University — Programming in C (CS3251), November/December 2025 (2025).
Write any two string handling functions in C with their syntax and purpose.
No verified answer or solution is available for this question.
Find the output of the following code. int main() { int a = 10, b = 20; change(&a, b); printf("\n Inside Main : %d %d\n", a, b); return 0; } void change(int *p, int q) { *p = *p*3; q = q*4; printf("\n Inside function : %d %d", *p, q); }
No verified answer or solution is available for this question.
If p points to a float array a[10] with base address 1000, what is the value of p after executing p++? Justify your answer.
No verified answer or solution is available for this question.
- 2026
- 2025
- 2023
Also asked in Anna University — Programming in C (CS3251), April/May 2026 (2026), Anna University — Programming in C (CS3251), November/December 2025 (2025).
Differentiate a structure and a union.
No verified answer or solution is available for this question.
Illustrate each of these operators with an example involving pointers or structures: &, *, ., ->.
No verified answer or solution is available for this question.
What are the values of argc and argv[] when the input "run with my values" is passed as command line arguments?
No verified answer or solution is available for this question.
- 2025
- 2023
Also asked in Anna University — Programming in C (CS3251), November/December 2025 (2025).
Name any two functions used in random access files and specify their use in C.
No verified answer or solution is available for this question.
(a) (i) Evaluate the following expressions using operator precedence. Explain the order of execution. (6 marks) (8*3-4)+(5%5 ? 3 : -9)+5-20/10 a*b+(c/d)-2^2-(e+4), where a = 2, b = 3, c = 8, d = 2, e = 5 (ii) Explain the various data types in C with suitable examples. (10 marks) (OR) (b) (i) Find the output of the following C code and discuss the execution steps. (4 marks) for(i=1,j=1; i<=10; ++i, ++j) { if (i == 3) { continue; } else { if (j == 4) { break; } else { printf("\ I am in loop, the values of I and J are: %d, %d", i,j); } } } (ii) Write a C program that accepts age and vaccination details. Use the conditional operator to print "Senior Citizen and Eligible for Booster" if age > 60 and the vaccination input is 2. Otherwise print "Below 60, and Eligible for Vaccination". (5 marks) (iii) Can an if-else ladder be converted to a switch-case statement? Illustrate if possible, or justify why it cannot be done. (7 marks)
No verified answer or solution is available for this question.
(a) (i) Write the string handling function used for each task: combine the first, last and middle names into the full name, show its character count, make the first name uppercase and last name lowercase, and print the full name in reverse order. (2 + 2 + 2 + 2 marks) (ii) Restaurant tables are arranged in rows and each row has an assigned waiter. Write a C program to find the highest bill served by each waiter. (8 marks) (OR) (b) (i) Explain binary search with an example. Show how to search for 14 in the array 12, 56, 90, 14, 19, 63, 88, 25, 37, 49, 110. (3 + 4 marks) (ii) A marathon has 5 tracks, each with n participants. Find the youngest and oldest participant in each track. (9 marks)
No verified answer or solution is available for this question.
(a) (i) Write a C program to create two 2D arrays using arrays of pointers. The first lists employee names and the second lists their designations. Display the designation when a name is entered. (13 marks) (ii) Give an example of a function that receives parameters and returns no value. (3 marks) (OR) (b) (i) Create an array of lucky ticket numbers, accept a ticket number, check it for a prize and display the result using a pointer to the array. (12 marks) (ii) Differentiate pass by value and pass by reference with an example. (4 marks)
No verified answer or solution is available for this question.
(a) (i) Give an example of a nested structure and a self-referential structure. (6 marks) (ii) List linked-list operations. Explain insertion at the end and deletion at the beginning of a singly linked list. (6 marks) (iii) Distinguish calloc() and malloc(). (4 marks) (OR) (b) (i) A furniture structure holds a shop's furniture information. Write a function call passing a pointer to the structure and the number of furniture items, and give the corresponding function definition statement. (8 marks) (ii) Write the function body that prints details of n furniture items. (4 marks) (iii) Use typedef to define furniture as an array of structures. (4 marks)
No verified answer or solution is available for this question.
(a) (i) State the purpose of fseek() in random access files. (3 marks) (ii) When are fread() and fwrite() used in file processing? (5 marks) (iii) List the modes in which a C file can be opened and explain the purpose of each. (5 marks) (iv) What is the use of feof()? (3 marks) (OR) (b) Write a C program that creates a binary file named application.txt with citizen name, Aadhaar number, PAN number, employment, gender and age. Filter by gender and employment and move male applicants who are self-employed into reject.txt. Assume at least 10 candidates.
No verified answer or solution is available for this question.