Computer Programming Lab is a subject in semester 1 of JNTUK R23 B.Tech. for all 19 B.Tech. branches. The full unit-wise syllabus is below.
| Subject name | Computer Programming Lab |
|---|---|
| Regulation | JNTUK R23 |
| Semester | 1 |
| Branches | all 19 B.Tech. branches |
| Category | Engineering Science |
| Credits | 1.5 |
| Semester scheme | Agri · AI&DS · AI&ML · Auto · Civil · CS · CSBS · CSD · CSE · CSE (AI&ML) · CSE (IoT & CS) · Cyber Security · ECE · EEE · Food Engg · IT · Mech · Mining · Pharma Engg |
Course Objectives
The course aims to give students hands ± on experience and train them on the concepts of the C- programming language.
Course Outcomes
- Read, understand, and trace the execution of programs written in C language.
- Select the right control structure for solving the problem.
- Develop C programs which utilize memory efficiently using programming constructs like pointers.
- Develop, Debug and Execute programs to demonstrate the applications of arrays, functions, basic concepts of pointers in C.
Unit I
Week 1
Objective: Getting familiar with the programming environment on the computer and writing the first program.
Suggested Experiments
Tutorial 1: Problem-solving using Computers.Lab 1: Familiarization with programming environmenti) Basic Linux environment and its editors like Vi, Vim & Emacs etc.ii) Exposure to Turbo C, gcciii) Writing simple programs using printf(), scanf()
Week 2
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
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 programsi) Sum and average of 3 numbersii) Conversion of Fahrenheit to Celsius and vice versaiii) Simple interest calculation
Week 3
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
Tutorial 3: Variable types and type conversions:Lab 3: Simple computational problems using arithmetic expressions.i) Finding the square root of a given numberii) Finding compound interestiii) Area of a triangle using herons formulaeiv) Distance travelled by an object
Study Computer Programming Lab on your phone: syllabus, notes and previous year question papers in iStudy.
Scan with your phone camera to install (Android & iPhone)
Unit II
Week 4
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
Tutorial4: Operators and the precedence and as associativity:Lab4: Simple computational problems using the operator precedence and associativityi) Evaluate the following expressions.
- A+B*C+(D*E) + F*G
- A/B*C-B+A*D/3
- A+++B—A
- J= (i++) + (++i)
ii) Find the maximum of three numbers using conditional operatoriii) Take marks of 5 subjects in integers, and find the total, average in float
Week 5
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
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
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
Tutorial 6: Loops, while and for loopsLab 6: Iterative problems e.g., the sum of seriesi) Find the factorial of given number using any loop.ii) Find the given number is a prime or not.iii) Compute sine and cos seriesiv) Checking a number palindromev) Construct a pyramid of numbers.
Unit III
Week 7:
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 search solution linear search.
Suggested Experiments
Tutorial 7: 1 D Arrays: searching.Lab 7:1D Array manipulation, linear searchi) Find the min and max of a 1-D integer array.ii) Perform linear search on1D array.iii) The reverse of a 1D integer arrayiv) Find 2s 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
Tutorial 8: 2 D arrays, sorting and Strings.Lab 8: Matrix problems, String operations, Bubble sorti) Addition of two matricesii) Multiplication two matricesiii) Sort array elements using bubble sortiv) Concatenate two strings without built-in functionsv) 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 arrayand memory de-allocation using malloc (), calloc (), realloc () and free () functions. Gain experience processing command-line arguments received by C
Suggested Experiments
Tutorial 9: Pointers, structures and dynamic memory allocationLab 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 structuresiii) Enter n students data using calloc() and display failed students listiv) 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
Tutorial 10: Bitfields, Self-Referential Structures, Linked listsLab10 : Bitfields, linked listsRead and print a date using dd/mm/yyyy format using bit-fields and differentiate the same without using bit- fieldsi) 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:
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
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 Eulers method
Week 12:
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
Tutorial 12: Recursion, the structure of recursive callsLab 12: Recursive functionsi) Write a recursive function to generate 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 Ackermann function using recursion.v) Write a recursive function to find the sum of series.WEEK 13:Objective: Explore the basic difference between normal and pointer variables, Arithmeticoperations using pointers and passing variables to functions using pointers
Suggested Experiments
Tutorial 13: Call by reference, dangling pointersLab 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.
Week 14Objective: To understand data files and file handling with various file I/O functions. Explore the differences between text and binary files.
Suggested Experiments
Tutorial 14: File handlingLab 14: File operationsi) 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 filevi) Write a C program to print last n characters of a given file.
Text Books
- Ajay Mittal, Programming in C: A practical approach, Pearson.
- Byron Gottfried, Schaum' s Outline of Programming with C, McGraw Hill
Reference Books
- Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, PrenticeHall of India
- C Programming, A Problem-Solving Approach, Forouzan, Gilberg, Prasad, CENGAGE
Study Computer Programming Lab on your phone: syllabus, notes and previous year question papers in iStudy.
Scan with your phone camera to install (Android & iPhone)
Related Subjects
- Engineering Physics
- Linear Algebra and Calculus
- Basic Electrical and Electronics Engineering
- Engineering Graphics
- Introduction to Programming
- IT Workshop
- Engineering Physics Lab