CO101
CO101
SUBMITTED TO SUBMITTED BY
Dr Rahul Gupta Mohammad Ayaan Abbas
24/A13/015
1st Semester
INDEX
S.No Problem Statement Date Page Signature
No
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 simple
interest.
LAB 2
1. Write a program to print the size
of different data types.
2. Write a program in C to print the
Area of circle when the radius of
circle is entered by the user.
3. Write a program to compute the
quotient and remainder when
dividend and divisor are given.
4. Write a C program to compute
the area and perimeter of a
rectangle with a height 7 inches
and width of 5 inches.
5. Write a C program to convert
the specified days into years,
weeks and days. Note: 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. WAP to evaluate the sum of
a five-digit number.
LAB 4
1. Write a program in C to check
whether the entered number is
prime or not.
2. Write a program in C, take
student age as input. If his 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”.
3. WAP in C to evaluate the sum
of a five-digit number.
LAB 5
1. Write a program to find if the year
entered is leap year or not.
2. Write a C program to check whether
a triangle is equilateral, isosceles or
scalene by taking lengths as input
of three sides from the user.
3. Write a program to check whether
the character is an alphabet, digit
or special character.
4. Write a program in C to read any
month number in integer and display
month name in word. (Using switch case)
5. Write a 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. WAP in C to implement switch case.
3. WAP in C to find exponential function.
LAB 7
1. Write a C program to check given
number is palindrome or not.
2. Write a program to print triangle of
stars in C :
Full pyramid
Half pyramid
Inverted half pyramid
Inverted full pyramid
3. Write a C program to print hollow
mirrored inverted right triangle star
pattern series of n using for/ while/
do while loop.
LAB 8
1. Write a program to search an
element in an array using linear search.
2. Write a program to search an element
in an array using binary search.
3. Write a program to find the average of
n numbers using array.
4. Given an array write a program to left
rotate the elements of the array by one.
5. Write a program for addition of two 3*3
Matrices
6. Write a program for the multiplication of
two matrices.
LAB 9
1. Write a program to find the length of a
string without using strlen function.
2. Write a program to count the number
of vowels in a string.
3. Write a program to reverse a string and
check given string is palindrome or not.
4. Write a program to compare two strings
and concatenate them.
5. Write program to convert a string from
lowercase to uppercase and vice versa.
LAB 10
1. Write a program to swap two numbers
using pointer/call by reference.
2. WAP in C to find the factorial of a
number using recursion.
3. Write a program to find area of circle,
rectangle, square and triangle using
function.
4. Write a program to generate 10 employee
details using structure. Enter employee
name, department (HR, TECH, SERVICE),
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 1
Q1) Write a program in C to understand the input and output
process.
OUTPUT :-
OUTPUT:-
Q4) Write a program to find simple interest.
OUTPUT:-
LAB 2
OUTPUT:-
Q2) Write a program in C to print the area of circle when the
radius of circle is entered by the user.
OUTPUT:-
OUTPUT:-
Q5) Write a C program to convert the specified days into years,
weeks and days. Note: Ignore leap year.
OUTPUT:-
LAB 3
OUTPUT:-
Q2) Write a program in C to swap two numbers.
OUTPUT:-
OUTPUT:-
Q5) WAP to evaluate the sum of a five-digit number.
OUTPUT:-
LAB 4
OUTPUT:-
Q2) Write a program in C, take student age as input. If his 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”.
OUTPUT:-
Q3) WAP in C to evaluate the sum of a five-digit number.
OUTPUT:-
OUTPUT:-
Q5) Write a program to check whether the input character is
vowel or consonant.
OUTPUT:-
LAB 5
OUTPUT:-
Q2) Write a C program to check whether a triangle is equilateral,
isosceles or scalene by taking lengths as input of three sides
from the user.
OUTPUT:-
Q3) Write a program to check whether the character is an
alphabet, digit or special character.
OUTPUT:-
Q4) Write a program in C to read any month number in integer
and display month name in word. (Using switch case)
OUTPUT:-
Q5) Write a program to input a number and check positive,
negative or zero using switch case.
OUTPUT:-
LAB 6
While loop:-
OUTPUT:-
For loop:-
OUTPUT:-
Do while loop:-
OUTPUT:-
OUTPUT:-
Q3) WAP in C to find exponential function.
OUTPUT:-
OUTPUT:-
Q5) Write a program to print the Fibonacci series till the nth
term.
OUTPUT:-
Q6) WAP to convert decimal to binary and vice versa.
Decimal to binary:-
OUTPUT:-
Binary to decimal:-
OUTPUT:-
LAB 7
OUTPUT:-
Q2) Write a program to print triangle of stars in C :
a. Full pyramid
b. Half pyramid
c. Inverted half pyramid
d. Inverted full pyramid
a. Full pyramid
OUTPUT:-
b. Half pyramid
OUTPUT:-
c. Inverted half pyramid
OUTPUT:-
d. Inverted full pyramid
OUTPUT:-
Q3) Write a C program to print hollow mirrored inverted right
triangle star pattern series of n using for/ while/ do while loop.
OUTPUT:-
LAB 8
OUTPUT:-
Q2) Write a program to search an element in an array using
binary search.
OUTPUT:-
Q3) Write a program to find the average of n numbers using
array.
OUTPUT:-
Q4) Given an array write a program to left rotate the elements
of the array by one.
OUTPUT:-
Q5) Write a program for addition of two 3*3 matrices
OUTPUT:-
Q6) Write a program for the multiplication of two matrices.
OUTPUT: -
LAB 9
OUTPUT:-
Q2) Write a program to count the number of vowels in a string.
OUTPUT:-
Q3) Write a program to reverse a string and check given string is
palindrome or not.
OUTPUT:-
Q4) Write a program to compare two string and concatenate
them.
OUTPUT:-
Q5) Write program to convert a string from lowercase to
uppercase and vice versa.
OUTPUT:-
LAB 10
OUTPUT:-
Q2) WAP in C to find the factorial of a number using recursion.
OUTPUT:-
Q3) Write a program to find area of circle, rectangle, square and
triangle using function.
OUTPUT:-
Q4) Write a program to generate 10 employee details using
structure. Enter employee name, department (HR, TECH,
SERVICE), 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.
OUTPUT:-