C Programming Lab: P.V.P.Siddhartha Institute of Technology (Autonomous), I B.Tech. Syllabus Under PVP14 Regulations
C Programming Lab: P.V.P.Siddhartha Institute of Technology (Autonomous), I B.Tech. Syllabus Under PVP14 Regulations
C Programming Lab: P.V.P.Siddhartha Institute of Technology (Autonomous), I B.Tech. Syllabus Under PVP14 Regulations
C PROGRAMMING LAB
(Common to ECE, AE during I B.Tech., I Semester)
(Common to EEE, CE, ME, CSE, IT during I B.Tech., II Semester)
Course Code(s) : AE1L2, EC1L3, CE2L3, ME2L3, CS2L3, IT2L3, EE2L3
Credits : 2
Lecture Hours : -- Internal Assessment : 25 marks
Lab Hours : 3 Semester end examination:50marks
Course Objectives:
Exercise1: Basics
Exercise3: Operators
1. Write a Program to demonstrate relational operators.(<,>,<=,>=,==,!=)
2. Write a program to check equivalence of two numbers using conditional operator.
3. Write a Program to demonstrate pre increment and post increment.(++a, a++ where
a is a value to be initialized)
4. Write a Program to demonstrate pre decrement and post decrement.(--a, a--where a
is a value to be initialized)
5. Write a program for computing the volume of sphere, cone and cylinder assume that
dimensions are integer’s use type casting where ever necessary.
Exercise4: Decision Statements
1. Write a Program to read marks of a student in six subjects and print whether pass or
fail (using if-else).
2. Write a Program to calculate roots of quadratic equation (using if-else).
3. Write a Program to calculate electricity bill. Read starting and ending meter reading.
The charges are as follows.
No. of Units Consumed Rate in(Rs)
1-100 1.50 per unit
101-300 2.00 per unit for excess of 100 units
301-500 2.50 per unit for excess of 300 units
501-above 3.25 per unit for excess of 500 units
Exercise5: Switch operations
1. Write a Program to perform arithmetic operations using switch case.
2. Write a Program to display colors using switch case (VIBGYOR).
3. Write a Program to display vowels and consonants using switch case.
4. Write a Program to display names of days in a Week using switch case.
Exercise6: Basic Loop operations
Do the Following Programs Using for, while, do-while loops.
1. Write a program to calculate sum of individual digits of a given number.
2. Write a program to check whether given number is palindrome or not.
3. Write a program to print prime numbers in the given range.
4. Write a program to display multiplication tables from 1 to 10 except 3 and 5.
Exercise7: Advanced loops
1. Write a program to print the Fibonacci series for given ‘N’ value.
P.V.P.Siddhartha Institute of Technology(Autonomous), I B.Tech. syllabus under PVP14 regulations
2. Write a program to find product of two numbers using functions without arguments,
without return type.
3. Write a program to find difference of two numbers using functions without
arguments, with return type.
4. Write a program to find sum of two numbers using functions with arguments &without
return type.
5. Write a program to find product of two numbers using functions with arguments, with
return type.
Exercise13: Functions and Recursion
1. Write a program to swap two numbers using
a) Call By Value B) Call By Reference.
2. Write a program to calculate factorial, gcd using recursion and non-recursion
functions.
3. Write program to perform arithmetic operations using pointer.
4. Write a program matrix addition using pointers.
Exercise14: Structures
1. Write a program to create structure for an account holder in a bank with following
Fields: name, account number, address, balance and display the details of five
account holders.
2. Write a program to find total marks of individual student and average marks for 10
students using structures.
3. Write a program to create structure called traveler and members of structure are
train no, coach no, seat no, source ,destination , gender, age, name and departure
date.
4. Write a program to illustrate passing an entire structure to a function.
Exercise15: File operations using command line arguments
1. Write a program which copies the contents of one file to another file using command
line arguments.
2. Write a program to reverse the first n characters in a file use command line
arguments.
Reference Books :
1.Problem Solving and Program Design in C, 4th edition, by jeri R. Hanly and Elli
B.Koffman.
P.V.P.Siddhartha Institute of Technology(Autonomous), I B.Tech. syllabus under PVP14 regulations