CO 102 LAB EXPERIMENTS LIST
LAB – 1
1. Write a program in C to understand the input and output process.
2. Write a program to print an integer and a float value.
3. Write a program to find the sum, difference, multiplication, division, and
average of two numbers.
4. Write a program to find the Simple Interest.
LAB – 2
1. Write a program to print the size of different data types.
2. Write a program in C to print area of circle when radius of circle is
entered by user.
3. Write a program to compute quotient and remainder when dividend and
divisor are given.
4. Write a program in C to compute the perimeter and area of rectangle
with a height of 7 inches and width of 5 inches.
5. Write a program in C to convert specified days into years, weeks, and
days. Ignore leap year.
LAB – 3
1. Write a program in C to check whether the entered number is prime or
not.
2. Write a program in C to swap two numbers.
3. Write a program in C to multiply two floating point numbers.
4. Write a program in C to print the ASCII value of characters.
5. Write a program in C to evaluate the sum of a five-digit number.
LAB – 4
1. Write a program in C, Take student age as an input. If the person age is
greater than or equal to 18 then show the message. “You are eligible for
voting” otherwise show the message “You are not eligible for voting” .
2. Write a program in C to check entered number is even or odd.
3. Write a program in C to check whether the input character is a vowel or
consonant.
LAB – 5
1. Write a C program to find out if the year entered is a leap year or not
2. Write a C program to check whether a triangle is Equilateral , Isosceles or
Scalene by taking the length as input of three sides from the user.
3. Write a C program to check whether a character is an alphabet, digit or
special character.
4. Write a C program to read any Month Number in integer and display
Month name in the word. ( Using Switch Case)
5. Write a C program to input a number and check positive, negative or
zero using switch case.
LAB – 6
1. Write a C program to print sum of digits of a number entered by a user
using for/while/do while loop.
2. Write a C program to implement switch case.
3. Write a C program to find exponential function.
4. Write a C program to find the factorial of a number using recursion.
5. Write a C program to print Fibonacci Series till the nth term.
6. Write a C program to convert decimal to binary and vice versa.
LAB -7
1. Write a C program to check given number is a palindrome or not.
2. Write a C program to print triangle of stars in
a. Full Pyramid
b. Half pyramid
c. Inverted full pyramid
d. Inverted half pyramid
3. Write a C program to print hollow mirrored inverted right triangle star
pattern series of n rows using for/while/do while loop.
Input : Input rows : 5
EXAMPLE:
*************
* *
* *
* *
*
LAB – 8
1. Write a C program to search an element in an array using linear search.
2. Write a C program to search an element in an array using binary search.
3. Write a C program to find the average of a n numbers using arrays.
4. Given an array, Write a C program to left rotate the elements of the array
by onr
Eg: Array Elements before rotating
1234567
Eg: Array Elements after rotating
3456712
5. Write a C program for addition of two 3*3 matrices.
6. Write a C program for multiplication of two matrices.
LAB – 9
1. Write a C program to find the length of a string without using strlen
function.
2. Write a C program to count number of vowels in a string.
3. Write a C program to reverse a string and check given string is a
palindrome or not.
4. Write a C program to compare string and concatenate two strings.
5. Write a C program to convert a string from lower case to upper case and
vise versa.
LAB – 10
1. Write a C program to swap two number two string and concatenate two
strings.
2. Write a C program to find factorial of number using recursion.
3. Write a C program to find area of circle, rectangle, square, and triangle
using function.
4. Write a C program to generate 10 employee details using structure. Enter
employee name, department (HR, SERVICE, TECH), salary, and rating (1-
5) from user. Update the salary by adding a 10% increment if the rating is
3 and more. Otherwise, add a 7% increment. Count the number of
employees in HR department and print their details.
LAB – 11
1. Write a C program to pass an array as a pointer that calculate sum of all
element of the array.
2. Write a C program to demonstrate the array of pointers.
3. Write a C program to pass an array as pointer and return to a function
hance calculate average of array elements.
4. Write a C program to create a file emp.txt and store information of a
person in terms of name, age, and salary.
5. Write a C program to copy content of one file into another file.
LAB – 12
1. Write a C program to implement binary search.
2. Write a C program to implement insertion sort.
3. Write a C program to implement selection sort.
4. Write a C program to implement bubble sort.