INTRODUCTION TO PROGRAMMING 2025-26 VR23

Introduction to Programming Syllabus
INTRODUCTION TO PROGRAMMING
Common to all branches of Engineering
I Year – I Semester  |  Code: 1005231101
Course Objectives:
  1. 1. Impart in-depth knowledge on the need of programming languages, problem-solving techniques, and program development skills.
  2. 2. Enable effective use of control structures and implement different operations on arrays.
  3. 3. Demonstrate the use of strings and functions.
  4. 4. Impart knowledge of pointers and memory allocation principles in C.
  5. 5. Understand structures, unions, and perform file operations in C.
Course Outcomes:
  • CO1: Illustrate fundamental concepts of computers and basics of computer programming.
  • CO2: Demonstrate control structures, branching, and looping statements.
  • CO3: Demonstrate arrays and pointers in solving complex problems.
  • CO4: Develop modular programs using functions and strings.
  • CO5: Demonstrate user-defined data types, solve real-world problems using structures, unions, and file operations.
UNIT I – Introduction to Computer Problem Solving
Programs and Algorithms, Problem Solving Requirements & Strategies
  • Programs and Algorithms, Computer Problem Solving Requirements, Phases of Problem Solving, Problem Solving Strategies, Top-Down Approach, Algorithm Designing, Program Verification, Improving Efficiency, Algorithm Analysis and Notations.
UNIT II – Introduction to C Programming
C Program Structure, Comments, Keywords, Variables, Data Types
  • Introduction, Structure of a C Program, Comments, Keywords, Identifiers, Data Types, Variables, Constants, Input/output Statements. Operators, Type Conversion. Control Flow, Relational Expressions: Conditional Branching Statements: if, if-else, if-else—if, switch. Basic Loop Structures: while, do-while loops, for loop, nested loops, The Break and Continue Statements, goto statement.
UNIT III – Arrays
One-Dimensional and Multi-Dimensional Arrays, Pointers
  • Introduction, Operations on Arrays, Arrays as Function Arguments, Two Dimensional Arrays, Multidimensional Arrays. Pointers: Concept of a Pointer, Declaring and Initializing Pointer Variables, Pointer Expressions and Address Arithmetic, Null Pointers, Generic Pointers, Pointers as Function Arguments, Pointers and Arrays, Pointer to Pointer, Dynamic Memory Allocation, Dangling Pointer, Command Line Arguments.
UNIT IV – Functions
Function Declaration, Recursion, Scope, Storage Classes
  • Introduction Function: Declaration, Function Definition, Function Call, Categories of Functions, Passing Parameters to Functions, Scope of Variables, Variable Storage Classes. Recursion. Strings: String Fundamentals, String Processing with and without Library Functions, Pointers and Strings.
UNIT V – Structures and Files
Bit Fields, Nested Structures, Arrays of Structures, Unions, Self-Referential Structures
  • Structures, Unions, Bit Fields: Introduction, Nested Structures, Arrays of Structures, Structures and Functions, Self-Referential Structures, Unions, Enumerated Data Type —Enum variables, Using Typedef keyword, Bit Fields. Data Files: Introduction to Files, Using Files in C, Reading from Text Files, Writing to Text Files, Random File Access.
Textbooks
  • A Structured Programming Approach Using C, Forouzan & Gilberg, Cengage.
  • How to Solve it by Computer, R.G. Dromey, Pearson.
  • Programming in C: A Practical Approach, Ajay Mittal, Pearson.
References
  • Byron Gottfried, Schaum’s Outline of Programming with C, McGraw-Hill.
  • Reema Thareja, Computer Programming, Oxford University Press.
  • The C Programming Language, Kernighan & Ritchie, Pearson.
Web Resources
  • http://www.c4learn.com/
  • http://www.geeksforgeeks.org/c/
  • https://nptel.ac.in/courses/122104019/
  • http://www.learn-c.org/

netaji gandi Thursday, August 7, 2025
COMPUTER PROGRAMMING LAB 2025-26

Computer Programming Lab 2025-26

COMPUTER PROGRAMMING LAB 2025-26 (Common to All branches of Engineering)

(I Year– I Semester - Course Code (1005231110) VR-23)

 COMPUTER PROGRAMMING LAB 2025-26

(Common to All branches of Engineering)

I Year– I Semester 

Course Code (1005231110)

VR-23

Course Objectives:
The course aims to give students hands-on experience and train them on the concepts of the C programming language.

Course Outcomes:
CO1: Read, understand, and trace the execution of programs written in the C language. (Understand)
CO2: Apply the right control structure for solving the problem. (Apply)
CO3: Develop, Debug and Execute programs to demonstrate the applications of arrays, functions, pointers and files in C. (Apply)
CO4: Improve individual/teamwork skills, communication and report writing skills with ethical values



UNIT I

WEEK 1  Click Link for Lab Notes


SAMPLE PROGRAMS

Objective: Getting familiar with the programming environment on the computer and writing the first program.

Suggested Experiments/Activities:

Tutorial 1: Problem-solving using Computers.
Lab 1: Familiarization with programming environment
i) Basic Linux environment and its editors like Vi, Vim & Emacs etc.
ii) Exposure to Turbo C, gcc
iii) Writing simple programs using printf() and scanf()


WEEK 2 Click Link for Lab Notes

Objective: Getting familiar with how to formally describe a solution to a problem in a series of finite steps both using textual notation and graphic notation.
Suggested Experiments /Activities:
Tutorial 2: Problem-solving using Algorithms and Flow charts.
Lab 1: Converting algorithms/flow charts into C Source code.
Developing the algorithms/flowcharts for the following sample programs
i) Sum and average of 3 numbers
ii) Conversion of Fahrenheit to Celsius and vice versa
iii) Simple interest calculation

WEEK 3 Click Link for Lab Notes Link2

Objective: Learn how to define variables with the desired data-type, initialize them with appropriate values and how arithmetic operators can be used with variables and constants.
Suggested Experiments/Activities:
Tutorial 3: Variable types and type conversions:
Lab 3: Simple computational problems using arithmetic expressions.
i) Finding the square root of a given number
ii) Finding compound interest
iii) Area of a triangle using heron’s formulae
iv) Distance travelled by an object

UNIT II


WEEK 4 Click Link for Lab Notes     LINK2

Objective: Explore the full scope of expressions, type-compatibility of variables &constants and operators used in the expression and how operator precedence works.
Suggested Experiments/Activities:
Tutorial4: Operators and the precedence and as associativity:
Lab4: Simple computational problems using the operator’ precedence and associativity
i) Evaluate the following expressions.
a. A+B*C+(D*E) + F*G
b. A/B*C-B+A*D/3
c. A+++B---A
d. J= (i++) + (++i)
ii) Find the maximum of three numbers using conditional operator
iii) Take marks of 5 subjects in integers, and find the total, average in float

WEEK 5 Click Link for Lab Notes

Objective: Explore the full scope of different variants of “if construct” namely if- else, null- else, if-else if*-else, switch and nested-if including in what scenario each one of them can be used and how to use them. Explore all relational and logical operators while writing conditionals for “if construct”.
Suggested Experiments/Activities:
Tutorial 5: Branching and logical expressions:
Lab 5: Problems involving if-then-else structures.
i) Write a C program to find the max and min of four numbers using if-else.
ii) Write a C program to generate electricity bill.
iii) Find the roots of the quadratic equation.
iv) Write a C program to simulate a calculator using switch case.
v) Write a C program to find the given year is a leap year or not.

WEEK 6  Click Link for Lab Notes

Objective: Explore the full scope of iterative constructs namely while loop, do-while loop and for loop in addition to structured jump constructs like break and continue including when each of these statements is more appropriate to use.
Suggested Experiments/Activities:
Tutorial 6: Loops, while and for loops
Lab 6: Iterative problems e.g., the sum of series
i) Find the factorial of given number using any loop.
ii) Find the given number is a prime or not.
iii) Compute sine and cos series
iv) Checking a number palindrome
v) Construct a pyramid of numbers.

UNIT III

WEEK 7:  Click Link for Lab Notes

Objective: Explore the full scope of Arrays construct namely defining and initializing 1-D and 2-D and more generically n-D arrays and referencing individual array elements from the defined array. Using integer 1-D arrays, explore the search solution linear search.
Suggested Experiments/Activities:
Tutorial 7: 1 D Arrays: searching.
Lab 7: 1D Array manipulation, linear search
i) Find the min and max of a 1-D integer array.
ii) Perform linear search on1D array.
iii) The reverse of a 1D integer array
iv) Find 2’s complement of the given binary number.
v) Eliminate duplicate elements in an array.

WEEK 8:

Objective: Explore the difference between other arrays and character arrays that can be used as Strings by using null character and get comfortable with string by doing experiments that will reverse a string and concatenate two strings. Explore sorting solution bubble sort using integer arrays.
Suggested Experiments/Activities:
Tutorial 8: 2 D arrays, sorting and Strings.
Lab 8: Matrix problems, String operations, Bubble sort
i) Addition of two matrices
ii) Multiplication two matrices
iii) Sort array elements using bubble sort
iv) Concatenate two strings without built-in functions
v) Reverse a string using built-in and without built-in string functions

UNIT IV
WEEK 9:

Objective: Explore pointers to manage a dynamic array of integers, including memory allocation & value initialization, resizing changing and reordering the contents of an array and memory de-allocation using malloc (), calloc (), realloc () and free () functions. Gain experience processing command-line arguments received by C
Suggested Experiments/Activities:
Tutorial 9: Pointers, structures and dynamic memory allocation
Lab 9: Pointers and structures, memory dereference.
i) Write a C program to find the sum of a 1D array using malloc()
ii) Write a C program to find the total, average of n students using structures
iii) Enter n students data using calloc() and display failed students list
iv) Read student name and marks from the command line and display the student
details along with the total.
v) Write a C program to implement realloc()

WEEK 10:

Objective: Experiment with C Structures, Unions, bit fields and self-referential structures (Singly linked lists) and nested structures
Suggested Experiments/Activities:
Tutorial 10: Bitfields, Self-Referential Structures, Linked lists
Lab10 : Bitfields, linked lists
Read and print a date using dd/mm/yyyy format using bit-fields and differentiate the same without using bit- fields
i) Create and display a singly linked list using self-referential structure.
ii) Demonstrate the differences between structures and unions using a C program.
iii) Write a C program to shift/rotate using bitfields.
iv) Write a C program to copy one structure variable to another structure of the same type.

UNIT V
WEEK 11: CLICK LINK FOR LAB NOTES

Objective: Explore the Functions, sub-routines, scope and extent of variables, doing some experiments by parameter passing using call by value. Basic methods of numerical integration.
Suggested Experiments/Activities:
Tutorial 11: Functions, call by value, scope and extent,
Lab 11: Simple functions using call by value, solving differential equations
using Eulers theorem.
i) Write a C function to calculate NCR value.
ii) Write a C function to find the length of a string.
iii) Write a C function to transpose of a matrix.
iv) Write a C function to demonstrate numerical integration of differential equations
using Euler’s method

WEEK 12: Click Link for Lab Notes

Objective: Explore how recursive solutions can be programmed by writing recursive functions that can be invoked from the main by programming at-least five distinct problems that have naturally recursive solutions.
Suggested Experiments/Activities:
Tutorial 12: Recursion, the structure of recursive calls
Lab 12: Recursive functions
i) Write a recursive function to generate the Fibonacci series.
ii) Write a recursive function to find the lcm of two numbers.
iii) Write a recursive function to find the factorial of a number.
iv) Write a C Program to implement the Ackermann function using recursion.
v) Write a recursive function to find the sum of the series.

WEEK 13: Click Link for Lab Notes

Objective: Explore the basic difference between normal and pointer variables, Arithmetic operations using pointers and passing variables to functions using pointers
Suggested Experiments/Activities:
Tutorial 13: Call by reference, dangling pointers
Lab 13: Simple functions using Call by reference, Dangling pointers.
i) Write a C program to swap two numbers using call by reference.
ii) Demonstrate Dangling pointer problem using a C program.
iii) Write a C program to copy one string into another using pointer.
iv) Write a C program to find no of lowercase, uppercase, digits
and other characters using pointers.

WEEK14: Click Link for Lab Notes

Objective: To understand data files and file handling with various file I/O functions. Explore the differences between text and binary files.
Suggested Experiments/Activities:
Tutorial 14: File handling
Lab 14: File operations
i) Write a C program to write and read text into a file.
ii) Write a C program to write and read text into a binary file using fread() and fwrite()
iii) Copy the contents of one file to another file.
iv) Write a C program to merge two files into the third file using command-line arguments.
v) Find no. of lines, words and characters in a file
vi) Write a C program to print last n characters of a given file.

Textbooks:

1. Ajay Mittal, Programming in C: A practical approach, Pearson.
2. Byron Gottfried, Schaum&'s Outline of Programming with C, McGraw Hill

Reference Books:

1. Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language,
Prentice- Hall of India
2. C Programming, A Problem-Solving Approach, Forouzan, Gilberg, Prasad, CENGAGE



netaji gandi

INTRODUCTION TO PROGRAMMING 2025-26 VR23

Introduction to Programming Syllabus INTRODUCTION TO PROGRAMMING Common to all branches of Engineering I Year – I Semester  ...