Type Here to Get Search Results !
திà®°ுக்குறள் / Thirukkural of the Day
Thiruvalluvar

CS25C01 Computer Programming Important Questions Anna University

MK 0

UNIT 1

Topic 1: Problem-Solving Methodology & Tools (PAC, Flowcharts, Pseudocode)

Core Concepts:

  • Define and explain the Problem Analysis Chart (PAC), Flowchart, Pseudocode, and Algorithm.

  • Compare interactive mode and script mode of execution with examples.

Integrated Problems (Develop PAC + Algorithm + Flowchart + Pseudocode):
  1. Largest of three numbers.
  2. First 10 natural numbers.
  3. Simple interest calculation.
  4. Checking if a number is a palindrome.
  5. Sum of digits of a number.
  6. Temperature conversion from Celsius to Fahrenheit.
  7. Generating the Fibonacci series.
  8. Counting vowels in a string.

Topic 2: C Fundamentals & Execution Flow

  • Explain the step-by-step execution process of a C program using a detailed block diagram.

  • Explain the types of errors in C (Syntax, Logical, Runtime) with examples and illustrative diagrams.

Topic 3: Data Types, Variables, Constants & Operators

  • Data Types & Variables: Write a detailed note on basic data types, variables, and constants with classification tables and examples.

  • Operators in C: Explain arithmetic, logical, relational, and bitwise operators with code examples.



UNIT 2

Topic 1: Decision Control Statements

  • Explain all decision-making structures (if, if-else, nested if-else, else-if ladder, switch) with syntax, flowcharts, and programs:

  1. Check if a number is positive, negative, or zero using if-else.
  2. Perform arithmetic operations (+, -, *, /) using switch-case.
  3. Detailed comparison: if-else vs. switch statements with suitable examples.

Topic 2: Looping Control Structures

  • Explain looping structures (while, do-while, for, nested loops) with syntax, flowcharts, and programs:

  1. Print the multiplication table of a number using a while loop.
  2. Reverse a given number using a do-while loop.
  3. Print prime numbers between 1 and 100 using a for loop.
  4. Generate star patterns/pyramids using nested loops.

Topic 3: Jump Statements & Integrated Menu-Driven Applications

  • Explain break, continue, goto, and return statements with code snippets demonstrating their impact inside loops.

  • Integrated Problem: Develop a menu-driven simple calculator using loops, switch, break, and continue.



UNIT 3

Topic 1: Modular Design, Prototypes & Function Mechanics

  • Explain the mechanics of a function call and execution flow in C.

  • Discuss modular programming benefits for testing, debugging, and software design.

  • Why are function prototypes essential in multi-file programs?

  • Explain the impact of global variables vs. static variables (preserving state between calls).

Topic 2: Recursion vs. Iteration

  • How recursion works internally using stack memory (with call stack diagram).

  • Compare iterative vs. recursive approaches for factorial (performance, memory usage, and suitability).

Topic 3: Function Programs (Iterative & Recursive)

  1. Find factorial of a number (Iterative vs. Recursive).
  2. Generate Fibonacci series (Iterative vs. Recursive).
  3. Calculate power of a number using recursion ($x^n$).
  4. Swap two numbers using Call by Value vs. Call by Reference (passing pointers/structures for performance).
  5. Check if a number is prime using a function.
  6. Calculate sum of digits using a function.
  7. Find largest among three numbers using functions.
  8. Count vowels in a string using a function.



UNIT 4

Topic 1: Pointers & Pointer Arithmetic

  • How pointer arithmetic varies for different data types (int, float, char).

  • Swap two numbers using pointers.

  • Array addition using pointer arithmetic.

Topic 2: Dynamic Memory Management

  • Static arrays vs. Dynamically allocated arrays (memory usage comparison).

  • How malloc(), calloc(), free(), and realloc() optimize array memory.

  • Program: Dynamically allocate memory for an array and find its average.

Topic 3: Strings & Pointer Manipulation

  • Why null termination (\0) is critical in string handling.

  • String manipulation using pure pointer arithmetic (without array indexing [] or <string.h>):

  1. Find length of a string (alternative to strlen()).
  2. Copy one string to another.
  3. Count vowels in a string using pointers.
  4. Input 5 strings and sort them alphabetically using an array of pointers.

Topic 4: Advanced Array Operations & Function Pointers

  • How 2D arrays are stored in memory (row-major order).

  • Display/print a matrix using pointer notation.

  • How function pointers enable callback mechanisms in modular design.



UNIT 5

Topic 1: User-Defined Data Types (Structures, Unions, Enumerations)

  • Structures: Definition, declaration, initialization, member accessing, array of structures, pointers to structures, and the arrow operator (->).

  • Unions: Definition, syntax, memory allocation, member accessing, and advantages over structures.

  • Enumerations (enum): Syntax, default vs. assigned values, use cases, and advantages.

  • Integrated Programs: Demonstrating structures (e.g., student record), unions, and enumerations in action.



UNIT 6

Topic 1: File Handling Operations & File Concepts

  • File Concepts: Differences between Text File and Binary File processing.

  • File Pointer Navigation: Explain fseek(), ftell(), and rewind() with examples.

  • Error Handling: How to detect and handle file opening/reading errors gracefully.

Topic 2: Text & Binary File Programs

  1. Read a text file and count the total number of words and lines.
  2. Read and display file contents line-by-line using fgets().
  3. Search for a specific word in a text file and count its occurrences.
  4. Copy contents from one text file to another using character I/O (fgetc() / fputc()).
  5. Append user input text to an existing file.
  6. Store and retrieve student records using binary files with fwrite() and fread() on an array of structures.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.