C Programming
Course Title: C Programming
Course No: BCA 102
Nature of the Course: Theory + Lab
Semester: 1
Full Marks: 20 + 20 + 60
Pass Marks: 8 + 8 + 24
Credit Hours: 3
Course Description
Course Objectives
Course Contents
- Formatted I/O: printf() and scanf()
- Unformatted I/O Functions: Character I/O (getchar(), putchar(), getch(), getche(), putch())
- if statement
- if-else statement
- Nested if-else statement
- else-if ladder
- switch statement
- Conditional operator (? :)
- while loop
- do-while loop
- for loop
- Nested loops
- break statement
- continue statement
- goto statement
- Introduction to functions: Advantages, function definition, function declaration/prototype
- function call
- Types of functions: Library functions vs. User-defined functions
- Function arguments: Call by value, Call by reference
- Recursion: Concepts and examples
- Introduction to arrays: Declaration, initialization, accessing elements
- One-dimensional arrays: Processing and examples
- Two-dimensional arrays: Declaration, initialization, accessing elements (matrix operations)
- Multi-dimensional arrays
- Arrays and functions
- Introduction to strings: Declaration, initialization
- String input/output(gets,puts)
- String handling functions(strlen,strrev,strcpy,strupr,strlwr,strcmp,strcat)
- Array of strings
- Defining and declaring structures
- Accessing members, including nested structures, arrays of structures
- Passing structures to functions
- Defining and declaring unions; comparison with structures
- Pointer arithmetic
- Pointers with arrays, strings, function, structure
- Concepts of files (text vs. binary) and file operations (opening, closing, reading, writing)
- File modes and standard I/O functions (fgetc, fputc, fgets, fputs, fprintf, fscanf, fread, fwrite)
- Random access (fseek, ftell, rewind) and error handling
- Introduction to main() function parameters (argc, argv)
- Passing and accessing arguments from the command line
- Introduction to graphics programming (basic concepts, graphics modes)
- Drawing primitives: Points, lines, and common geometric shapes (rectangles, circles, ellipses, arcs, polygons)
- Managing colors and fill styles for graphical output
- Displaying and formatting text in graphics mode
- Fundamentals of simple animation (clearing the screen, redrawing elements, using delays)
Laboratory Works
- 1.Fundamental Programming Constructs
- 2.Control Flow Mechanisms
- 3.Functions and Modularity
- 4.Array and String Manipulation
- 5.Pointers and Dynamic Memory
- 6.Structured Data Types
- 7.File Operations
- 8.Command-Line Interaction
- 9.Basic Graphics Programming
Text Books
- 1.Deitel, P. J., & Deitel, H. M. (n.d.). C how to program (Latest ed.). Pearson Education.
- 2.Kernighan, B. W., & Ritchie, D. M. (n.d.). The C programming language (Latest ed.). Prentice Hall.
- 3.Prata, S. (n.d.). C primer plus (Latest ed.). Pearson Education.
Reference Books
- 1.Balagurusamy, E. (n.d.). Programming in ANSI C (Latest ed.). Tata McGraw-Hill Education.