Nepal's open education portal

EduNepalEduNepal

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

BCA Curriculum 2079

Unit 2•Unit 2 of 3

Unit 2: Operators and Expressions

Table of Contents (20 Verified Experiments)

  1. Lab 01: Basic I/O, Arithmetic Operations and Formatting Specifiers
  2. Lab 02: Conditional Statements (Largest of 3 numbers using nested if-else)
  3. Lab 03: Menu-Driven Calculator using Switch-Case Statement
  4. Lab 04: Fibonacci Series Generation using For and While Loops
  5. Lab 05: Prime Number Verification and Range Generation
  6. Lab 06: Sum and Reverse of Digits of an Integer
  7. Lab 07: 1D Array Input, Sorting (Bubble Sort), and Searching
  8. Lab 08: Matrix Addition and Subtraction of Order M x N
  9. Lab 09: Matrix Multiplication with Dimensional Compatibility Check
  10. Lab 10: String Operations without String Library Functions (strlen, strcpy, strcat, strrev)
  11. Lab 11: Palindrome String Verification using Character Arrays
  12. Lab 12: Swap Two Numbers using Call by Value vs Call by Reference (Pointers)
  13. Lab 13: Factorial Calculation using Recursive Functions
  14. Lab 14: Greatest Common Divisor (GCD) using Euclids Algorithm
  15. Lab 15: Dynamic Memory Allocation for 1D Array using malloc() and free()
  16. Lab 16: Student Record Management using Structures (Name, Roll, Marks, Percentage)
  17. Lab 17: Array of Structures Sorting by Student Roll Number
  18. Lab 18: Writing and Reading Formatted Data to a Sequential Text File (fprintf and fscanf)
  19. Lab 19: Copying Contents of One File to Another Character by Character (fgetc and fputc)
  20. Lab 20: Binary Record Storage and Retrieval using fwrite() and fread()

Related notes

View all →

Related video lessons

View all →

Practice questions

View all →
  • 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

View all questions for this subject →

← Back to all notes