PREVIOUS YEAR QUESTION PAPER

CS6101 – Programming with C

Anna University

Regulation 2018 Semester 1 2024

Question Paper Details

University Anna University
Degree B.E. Computer Science and Engineering
Department Computer Science and Engineering
Regulation Regulation 2018
Semester 1
Subject Code CS6101
Subject Name Programming with C
Exam Session November / December 2024
Duration 180 minutes
Maximum Marks 100

View Question Paper PDF

Access the previous year question paper for your examination preparation.

View / Download PDF

How to Use This Question Paper

More Question Papers

Browse other previous year question papers for this subject.

View All Subject Question Papers

Question Paper Intelligence

Automatically extracted historical question data. Academic accuracy and examination rules require verification.

23Extracted entries
100Maximum marks (metadata)
180Duration (minutes)
0Choice candidates

Part-wise extracted questions

Part A10
Part B12
Part C1

Question type candidates

Other Or Unclassified17
Explanation4
Short Description2

Section marks — arithmetic candidates

Part A20 marks
Part B64 marks
Part C16 marks

Examination marks pattern

PartRequired answersMarks per answerSection total
A10220
B8864
C2816

Estimated time allocation

Proportional to section marks. This estimate uses the full exam duration without a separate reading or revision reserve.

Section time budget

Part A36.0 min
Part B115.2 min
Part C28.8 min

Question navigator

Extracted questions

Part A — 1

W h a t are the main steps involved in executing a p r o g r a m f r o m s o u r c e code to 2 running application?

Other Or Unclassified

Source quality review required

Part A — 2

State any four special features of C L a n g u a g e 2

Short Description

Source quality review required

Part A — 3

W h a t is the p u r p o s e of the conditional operator (?:) in p r o g r a m m i n g ? 2

Other Or Unclassified

Source quality review required

Part A — 4

W h a t is the role of header files in C language 2

Other Or Unclassified

Source quality review required

Part A — 5

Predict the output of the following C C o d e 2 # i n c l u d e <stdio.h> int main() { int arr[] = {10, 20, 30, 40, 50}; int *ptr = arr; printf("%d % d % d \ n " , *ptr, *(ptr + 2), *(arr + 4)); return 0; }

Other Or Unclassified

Source quality review required

Part A — 6

H o w does a do-while loop differ f r o m a while loop? 2

Other Or Unclassified

Source quality review required

Part A — 7

Write a code snippet to to declare a 2x3 niulti-dimensional array a n d initialize it 2 with values..

Other Or Unclassified

Source quality review required

Part A — 8

State how a pointer variable differ from a variable? 2

Short Description

Source quality review required

Part A — 9

Write a function in C to calculate the factorial of a n u m b e r using recursion. 2

Other Or Unclassified

Source quality review required

Part A — 10

W h a t is e n u m e r a t e d d a t a t y p e ? 2

Other Or Unclassified

Source quality review required

Part B — 11

(i) W h a t is m e a n t by p r e c e d e n c e and associativity of operators in C ? Explain 4. with an e x a m p l e . Exemplify the use of 'break' and 'continue' statements in C with suitable 4 e x a m p l e .

Other Or Unclassified

Source quality review required

Part B — 12

(i) Explain h o w logical relationship is checked in C p r o g r a m ? 4 (ii) W h a t are formatted input a n d output statements in C ? Give suitable 4 e x a m p l e s .

Other Or Unclassified

Source quality review required

Part B — 13

(i) H o w d o y o u store and access elements in a multi-dimensional array? 4 Provide an example. f (ii) Write a C p r o g r a m to print the following on the screen using nested loops 4 1 2 3 4 5 6 7 8 9 10

Other Or Unclassified

Source quality review required

Part B — 14

(i) Write a C p r o g r a m to print the s u m of the following series up to n t e r m s w h e r e 4 n is given by the user: x - x^/Sl + x^/SI -... (The value of x is given by the user.) (ii) Write a C p r o g r a m to find a n d print the factorial of the first 'n' n u m b e r s that 4 are not divisible by 2 or 3.

Other Or Unclassified

Source quality review required

Part B — 15

Write a C p r o g r a m to sort the given list of e l e m e n t s and to find the s e c o n d 8 largest e l e m e n t in an array.

Other Or Unclassified

Source quality review required

Part B — 16

Explain in detail h o w the data is p a s s e d fto a function by writing a function that 8 takes a d e c i m a l n u m b e r a n d b a s e as a r g u m e n t a n d returns the equivalent n u m b e r of the given base.

Explanation

Source quality review required

Part B — 17

(i) .Explain the use of string operators in C with e x a m p l e s 4 (ii) Write a p r o g r a m that uses a function to add a string to the e n d of another string 4 without using any library function

Other Or Unclassified

Source quality review required

Part B — 18

Explain in detail about the pointers in C and Write a program to swap two numbers 8' using pointers.

Explanation

Source quality review required

Part B — 19

Write a C p r o g r a m to find the m a x i m u m and m i n i m u m elements in a sorted 8 array by passing the array pointer to a subroutine.

Other Or Unclassified

Source quality review required

Part B — 20

Explain the use of various pre-processor directives with suitable e x a m p l e s . 8

Explanation

Source quality review required

Part B — 21

Brief about h o w the files are handled in C p r o g r a m s with appropriate formats 8

Other Or Unclassified

Source quality review required

Part B — 22

Discuss in details about the dynamic memory allocation functions in C with example. 8 I

Explanation

Source quality review required

Part C — 23

Write a C p r o g r a m using structures to store the data of 'n' books, w h e r e 'n' is given 8 by the user (use d y n a m i c m e m o r y allocation). Include a m e n u that will allow the user to select any of the following features: a. Use a function to display the book information while getting the book with the m a x i m u m and m i n i m u m price. b. U s e a function to display the book records in alphabetical order by title. c. U s e a function to display the book records by their genre (e.g.. Fiction, Non-fiction, Science, etc.). 24 ' Discuss h o w binary files are created and m a n a g e d in C with a p r o g r a m to implement 8 the following: a. Create t w o files namely source and destination. b. R e a d a character f r o m the source file and write the s a m e into the destination file till end-of-file is not reached. c. Delete the s o u r c e file at last. 3

Other Or Unclassified

Source quality review required

Advanced Examination Analysis

Historical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.