C Programming Laboratory Manual — 20 Practical Programs with Output
Official practical laboratory manual containing 20 complete C programming experiments, source codes, flowcharts, and verified outputs for TU BCA.
C Programming · CACS101 · Semester 1
Unit 2•Unit 2 of 3
Unit 2: Operators and Expressions
Table of Contents (20 Verified Experiments)
- Lab 01: Basic I/O, Arithmetic Operations and Formatting Specifiers
- Lab 02: Conditional Statements (Largest of 3 numbers using nested if-else)
- Lab 03: Menu-Driven Calculator using Switch-Case Statement
- Lab 04: Fibonacci Series Generation using For and While Loops
- Lab 05: Prime Number Verification and Range Generation
- Lab 06: Sum and Reverse of Digits of an Integer
- Lab 07: 1D Array Input, Sorting (Bubble Sort), and Searching
- Lab 08: Matrix Addition and Subtraction of Order M x N
- Lab 09: Matrix Multiplication with Dimensional Compatibility Check
- Lab 10: String Operations without String Library Functions (strlen, strcpy, strcat, strrev)
- Lab 11: Palindrome String Verification using Character Arrays
- Lab 12: Swap Two Numbers using Call by Value vs Call by Reference (Pointers)
- Lab 13: Factorial Calculation using Recursive Functions
- Lab 14: Greatest Common Divisor (GCD) using Euclids Algorithm
- Lab 15: Dynamic Memory Allocation for 1D Array using
malloc()andfree() - Lab 16: Student Record Management using Structures (Name, Roll, Marks, Percentage)
- Lab 17: Array of Structures Sorting by Student Roll Number
- Lab 18: Writing and Reading Formatted Data to a Sequential Text File (
fprintfandfscanf) - Lab 19: Copying Contents of One File to Another Character by Character (
fgetcandfputc) - Lab 20: Binary Record Storage and Retrieval using
fwrite()andfread()
CS50x Introduction to C Programming Lecture (David J. Malan)
Open lesson pageLesson videos
Related notes
- C Programming — Complete Course Notes (BCA 1st Sem)Notes
- Unit 1: Introduction to Programming Concepts and C Language NotesNotes
- Unit 2: Operators and Expressions NotesNotes
- Unit 3: Input and Output Operations NotesNotes
- Unit 4: Control Statements and Decision Making NotesNotes
- Unit 5: Arrays and String Manipulations NotesNotes
Related video lessons
Practice questions
- Which of the following is an invalid variable name in C? (a) _salary (b) 1st_rank (c) total_sum (d) age2objective · 1 marks
- What is the return type of the `malloc()` function in C? (a) `int*` (b) `char*` (c) `void*` (d) `float*`objective · 1 marks
- Explain the difference between call by value and call by reference in C with suitable code snippets.short · 5 marks
- What is recursion? Write a recursive function in C to calculate the factorial of a positive integer.short · 5 marks
- Explain dynamic memory allocation in C. Differentiate between `malloc()` and `calloc()`. Write a C program to dynamically allocate memory for N integers, sort them in ascending order, and free the memory.long · 10 marks
