CP Lab Record
CP Lab Record
CP Lab Record
CONTENTS
EXP. PAGE
DATE TITLE OF EXPERIMENT REMARKS
NO NO
FAMILIARIZATION OF CONSOLE I/O AND
1
OPERATORS IN C
3 PRIME NUMBER
4 ARMSTRONG NUMBER
6 LINEAR SEARCH
7 BUBBLE SORTING
8 PALINDROME
9 STRING OPERATIONS
10 EUCLIDEAN DISTANCE
13 FACTORIAL
15 MATRIX
16 POINTERS
17 FILE OPERATIONS
2
AIM
PROGRAM
2. Program to Read two numbers, add them and display their sum.
3. Program to Read the radius of a circle, calculate its area and display it
OUTPUT
>>Hello World
4
2. Output of Read two numbers, add them and display their sum.
3. Output of Read the radius of a circle, calculate its area and display it
>>Radius of Circle = 15
>>Area of Circle = 706.86
EXP. NO: 2
__/__/2024 LARGEST NUMBER AMONG 3 INTEGERS
AIM
To write a C program to Read 3 integer values and find the largest among them.
ALGORITHM
FLOWCHART
PROGRAM
#include<stdio.h>
int main()
{
float n1, n2, n3;
printf("Enter three numbers:\n");
scanf("%f %f %f", &n1, &n2, &n3);
OUTPUT
EXP. NO: 3
__/__/2024 PRIME NUMBER
AIM
To write a C program to Read a Natural Number and check whether the number is prime
or not.
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
8
EXP. NO: 4
__/__/2024 ARMSTRONG NUMBER
AIM
To write a C program to Read a Natural Number and check whether the number is
Armstrong or not.
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
9
AIM
To write a C program to Read n integers, store them in an array and find their sum
and average.
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
10
EXP. NO: 6
__/__/2024 LINEAR SEARCH
AIM
To write a C program to Read n integers, store them in an array and search for an element
in the array using an algorithm for Linear Search
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
11
EXP. NO: 7
__/__/2024 BUBBLE SORTING
AIM
To write a C program to Read n integers, store them in an array and sort the elements
in the array using Bubble Sort algorithm
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
12
EXP. NO: 8
__/__/2024 PALINDROME
AIM
To write a C program to Read a string (word), store it in an array and check whether it
is a palindrome word or not.
PROGRAM
OUTPUT
13
EXP. NO: 9
__/__/2024 STRING OPERATIONS
AIM
1. To write a C program to Read two strings (each one ending with a $ symbol), store
them in arrays and concatenate them without using library functions.
2. To write a C program to Read a string (ending with a $ symbol), store it in an array
and count the number of vowels, consonants and spaces in it.
PROGRAM
OUTPUT
14
EXP. NO: 10
__/__/2024 EUCLIDEAN DISTANCE
AIM
To write a C program to Read two input each representing the distances between two
points in the Euclidean space, store these in structure variables and add the two distance
values.
PROGRAM
OUTPUT
15
EXP. NO: 11
__/__/2024 DATA MANIPULATION USING STRUCTURE
AIM
To write a C program to Using structure, read and print data of n employees (Name,
Employee Id and Salary)
PROGRAM
OUTPUT
16
EXP. NO: 12
__/__/2024 DATA MANIPULATION USING UNION
AIM
PROGRAM
OUTPUT
17
EXP. NO: 13
__/__/2024 FACTORIAL
AIM
To write a C program to Find the factorial of a given Natural Number n using recursive
and non-recursive functions
ALGORITHM
FLOWCHART
PROGRAM
OUTPUT
18
AIM
To write a C program to Read a string (word), store it in an array and obtain its reverse
by using a user defined function.
PROGRAM
OUTPUT
19
EXP. NO: 15
__/__/2024 MATRIX
AIM
To write a menu driven C program for performing matrix addition, multiplication and
finding the transpose. Use functions to (i) read a matrix, (ii) find the sum of two matrices,
(iii) find the product of two matrices, (iv) find the transpose of a matrix and (v) display a
matrix.
PROGRAM
OUTPUT
20
EXP. NO: 16
__/__/2024 POINTERS
AIM
PROGRAM
OUTPUT
21
EXP. NO: 17
__/__/2024 FILE OPERATIONS
AIM
PROGRAM
OUTPUT