// Anna University, Chennai / 2022
Anna University — Programming in C (CS3251), November/December 2022
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.
What are the various types of operators?
No verified answer or solution is available for this question.
What is the use of a preprocessor directive?
No verified answer or solution is available for this question.
Declare a float array of size 5 and assign 5 values to it.
No verified answer or solution is available for this question.
Sort the following elements using selection sort: 23, 55, 16, 78, 2.
No verified answer or solution is available for this question.
How is pointer arithmetic done?
No verified answer or solution is available for this question.
Which is better to use, a macro or a function? Justify your answer.
No verified answer or solution is available for this question.
What is meant by structure definition?
No verified answer or solution is available for this question.
Define a self-referential data structure.
No verified answer or solution is available for this question.
Why are files needed?
No verified answer or solution is available for this question.
Give an example for fseek().
No verified answer or solution is available for this question.
(a) Explain the storage classes in C with suitable examples. (OR) (b) Explain looping statements in C with suitable examples.
No verified answer or solution is available for this question.
(a) (i) Write a C program to multiply two matrices (2D arrays) from user input. (8 marks) (ii) Write a C program to find the scaling of two matrices (2D arrays) entered by a user. (8 marks) (OR) (b) (i) Write a C program to find the determinant of a matrix (2D array) entered by a user. (8 marks) (ii) Write a C program for matrix transpose. (8 marks)
No verified answer or solution is available for this question.
(a) (i) Classify the function prototypes with suitable examples. (8 marks) (ii) Write a C program to design a scientific calculator using built-in functions. (8 marks) (OR) (b) (i) Explain pass by value and pass by reference. Write a C program to swap the contents of two variables using pass by reference. (8 marks) (ii) Explain pointers and their use with arrays, with a suitable example. (8 marks)
No verified answer or solution is available for this question.
(a) What is a structure? Create a structure with members of various types and declare two structure variables. Write a program to read and print their data. Justify the need for a structured data type. (OR) (b) Write a C program to create marksheets for students using a self-referential structure.
No verified answer or solution is available for this question.
(a) (i) Write a C program to get the names and marks of n students from the user and store them in a file. (8 marks) (ii) Write a C program to read names and marks of n students from the user and store them in a file. If the file already exists, append the information. (8 marks) (OR) (b) (i) Write a C program to write all members of an array of structures to a file using fwrite(). Read the array from the file and display it. (8 marks) (ii) Describe command line arguments with an example C program. (8 marks)
No verified answer or solution is available for this question.