Home > Computer Science and Engineering / Information Technology > Programming in C

CS3251 Programming in C Previous Year Question Papers - Anna University

Explore the Previous Year Anna University Question Papers of CS3251 Programming in C.

2024

  • 2024 - CSE-AM-2024-CS 3251-Programming in C-567353150-50895.pdf
  • 2024 - CSE-ND-2024-Cs 3251-Programming in C-414205171-20250604161745.pdf

2023

  • 2023 - CSE-ND-2023-CS 3251-Programming in C-905251280-20861.pdf

2022

  • 2022 - CSE-AM-2022-CS 3251-Programming in C-158786852-CS 3251.pdf
  • 2022 - CSE-ND-2022-CS 3251-Programming in C-578771078-ND22CS (3).pdf

Important Questions - CS3251 Programming in C

UNIT I: Basics of C Programming

Part A (2 Marks)

  • List the different data types available in C.
  • Explain the difference between ++a and a++ (pre vs. post increment).
  • What are the various types of operators in C?
  • Define preprocessor directives and give two examples.
  • State the importance of keywords and identifiers.

Part B (13/15 Marks)

  • Describe the structure of a C program with an example.
  • Explain decision-making statements (if-else, switch-case) with sample programs.
  • Discuss the various looping statements (for, while, do-while).
  • Explain the compilation process in C in detail.

UNIT II: Arrays and Strings

Part A (2 Marks)

  • Define an array and provide its syntax.
  • List the main string manipulation functions (e.g., strcpy, strlen).
  • What is the difference between a one-dimensional and two-dimensional array?
  • Explain the role of the null character \0 in strings.

Part B (13/15 Marks)

  • Write a program to perform matrix operations like addition, multiplication, or transpose.
  • Explain searching algorithms (Linear Search and Binary Search).
  • Implement sorting using the Selection Sort algorithm.
  • Discuss string operations like length, compare, and concatenate with examples.

UNIT III: Functions and Pointers

Part A (2 Marks)

  • What is a function prototype and why is it needed?
  • Define recursion and give a simple example.
  • What is an address operator (&) and an indirection operator (*)?
  • Differentiate between actual and formal parameters.

Part B (13/15 Marks)

  • Explain parameter passing methods: Pass by Value vs. Pass by Reference with a swapping program.
  • Discuss modular programming and the classification of functions based on inputs/outputs.
  • Write a program for binary search using a recursive function.
  • Explain pointer arithmetic and its relationship with arrays.

UNIT IV: Structures and Union

Part A (2 Marks)

  • Define a structure and write its syntax.
  • How do you access members of a structure?
  • What is the use of typedef in C?
  • Compare structures and unions in terms of memory allocation.

Part B (13/15 Marks)

  • Explain nested structures and array of structures with an example program.
  • Discuss dynamic memory allocation functions (malloc, calloc, realloc, free).
  • Explain self-referential structures and their role in linked lists.
  • Implement a Singly Linked List and its basic operations (insertion/deletion).

UNIT V: File Processing

Part A (2 Marks)

  • List different file opening modes (e.g., "r", "w", "a").
  • What are command line arguments?
  • Define sequential access and random access in file processing.
  • Explain the purpose of fseek() and ftell().

Part B (13/15 Marks)

  • Explain the various file operations (open, read, write, close) in detail.
  • Discuss random access file processing and the functions used to implement it.
  • Write a C program to copy the contents of one file to another or process student records using files.
  • Illustrate the use of argc and argv with a command-line program.

Most Repeated / High-Weight Questions

Pointer arithmetic and arrays, function parameter passing, recursion, linked lists, dynamic memory allocation, file operations, string manipulation, matrix operations.

Additional Resources

View Syllabus View Notes

How to Use These Question Papers