Programming Lab Lessson Plan 2024 Autumn (1)
Programming Lab Lessson Plan 2024 Autumn (1)
(L-T-P-Cr: 0-2-4-4)
Instructor Name:
Instructor Chamber:
Sr Details Week#
#
Sessional Exam
13
1st December-7th December
Technical Assistants Names: Prasanta Kumar Sahoo, Ruchika
Katyani
Q# Experiment Details
Set 2 Set2
Input values for a, b The Roots are real &
and c=>1 8 3 unequal.
Roots are -0.39 and -
7.61
Set 3 Set 3
Input values for a, b The Roots are
and c=>3 5 7 imaginary
Root1=-0.17+i1.28
Root2=-0.17-i1.28
6 WAP to display the grade Set-1 Set-1
system of KIIT University Enter total mark
based on total marks secured by a student: Secured grade is C
secured by a student in a 55
semester. Assume marks Secured grade is C Set-2
are integer values. Use Secured grade is O
multiple if-else statement. Set-2
The grade is calculated is Enter total mark
as follows: secured by a student:
Marks Grade 95
90 to 100 O Secured grade is O
80 to 89 E
70 to 79 A
60 to 69 B
50 to 59 C
40 to 49 D
< 40 F
Q# Experiment Details
Day 7
Lab Assignments
Q# Experiment Details Input Output
1 WAP to print even series 2 4 6 8 10 12 14 16 18
within 50. 20 22 24 26 28 30 32 34
36 38 40 42 44 46 48 50
Home Assignments
Q# Experiment Details Input Output
1 WAP to find out factors of a Set 1 Set 1
number. n=6 The factors are
1236
Set 2 Set 2
n=21 The factors are
1 3 7 21
2 WAP to test whether a number Set 1 Set 1
is Armstrong Number or not. n=153 The given number is
(A number is said to be Armstrong
Armstrong when the sum of Set 2 Set 2
cubes of its digit is equal with n=121 The given number is not
the original number. Armstrong
Ex-153)
3 WAP to test whether a number Set 1 Set 1
is Palindrome Number or not. n=234 The given number is not
(A number is said to be Palindrome
Palindrome when its reverse is Set 2 Set 2
equal with the original number. n=121 The given number is
Ex-121) Palindrome
Day 8
Lab Assignments
Q# Experiment Details Input Output
1. WAP to print Fibonacci series Set 1 Set 1
up to n terms. n=5 01123
Set 2 Set 2
n=10 0 1 1 2 3 5 8 13 21
34
2 WAP to test whether a number Set 1 Set 1
is Perfect Number or not.
n=7 The given number
(A number is said to be Perfect is not Perfect
when the sum of factors
excluding the number itself is Set 2
Set 2
equal to the original number.
The given number
n=28 is Perfect
Ex-6)
1 3 4 7 11 18 29 …
5 WAP to print GCD and LCM of Enter two numbers: GCD of 12 and 18 is
two numbers. 6
12
LCM of 12 and 18 is
18 36
Set 2 Set 2
n=4 Factorial is 24
22
4. WAP to find out sum of series up to Enter the The sum of series is
n terms. range: 3.180134
(1+1/2+1/3………) 13
2 2
Set 2: Set 2:
2 3
Lab Assignments
1. WAP to find out sum of series up to Enter the The sum of series is
n terms value of n: 873612.0
1+22+33+……….+nn 7
2. WAP to find out sum of series up to Enter the The sum of series is
n terms value of n: 13.477573
7
Home Assignments
1. WAP to print the Enter the value of *
following pattern n: ***
* 5 *****
*** *******
***** *********
*******
*********
2. WAP to print the Enter the value of A
following pattern n: BA
A 5 CBA
BA DCBA
CBA EDCBA
DCBA
EDCBA
3. Write a C program to Enter the value of * * * **
print a hollow square n: * *
pattern using a while 4 * *
loop. For row=4 *** **
*****
* *
* *
*****
4. WAP to print the Enter the value of *********
following pattern n: *******
********* 5 *****
******* ***
***** *
***
*
5 WAP to print the Enter the value of 1
following pattern n: 21
1 5 123
21 4321
123 12345
4321
12345
Home Assignments (Book Exercises)
Q# Experiment Details
Array
Week 6 & 7
DAY 11
Lab Assignments
4. WAP to find the second Input the size of The Second largest
largest element in an array. array: 5 element in the array
Input 5 elements in is: 6
the array:
element - 0: 2
element - 1: 9
element - 2: 1
element - 3: 4
element - 4: 6
5. WAP to delete an element at Input the size of The new list is: 1
desired position from an array: 5 2 4 5
array. Input 5 elements in
the array in
ascending order:
element - 0: 1
element - 1: 2
element - 2: 3
element - 3: 4
element - 4: 5
Input the position
where to delete: 3
DAY-12
TOPIC: 1-D Arrays (Contd…)
1. WAP to display the array Set-1 Set-1
elements in ascending Enter how many The Numbers in
order. numbers: 7 ascending order are
Enter the 7 2445678
Numbers:
7645248
Set-2
Set-2 The Numbers in
Enter how many ascending order:
numbers :10 12 34 34 56 56 56
Enter the 10 78 90 122 799
Numbers:
12 34 56 78 90 34
56 799 122 56
2. WAP to Print all unique Input the number of The unique elements
elements of an array. elements to be found in the array
stored in the array: 4 are:
Input 4 elements in 35
the array:
element - 0: 3
element - 1: 2
element - 2: 2
element - 3: 5
3. WAP to print all the even Enter number of Even numbers in the
and odd numbers in an 1-D elements in the array are: 12 98
array. array: 6
Enter 6 elements in Odd numbers in the
the array: 12 19 45 array are: 19 45 69
69 98 23 23
DAY-13, DAY-14
TOPIC: 2D Arrays
Set-2
Value of matrix a
Set-2: 222
Enter value of matrix 222
a 222
222222222 Value of matrix b
Enter value of matrix 333
b 333
333333333 333
After Multiplication
resultant matrix is
18 18 18
18 18 18
18 18 18
4. WAP to find the sum of Set 1: Set 1:
elements of a matrix in Enter no. of rows: 3
its upper triangle. Enter no. of cols: 3 The given matrix is:
Enter values to the 9 8 7
matrix : 6 5 4
Enter a [0][0] value: 9 3 2 1
Enter a [0][1] value: 8
Enter a [0][2] value: 7 Sum of upper triangular
Enter a [1][0] value: 6 matrix = 19
Enter a [1][1] value: 5
Enter a [1][2] value: 4
Enter a [2][0] value: 3
Enter a [2][1] value: 2
Enter a [2][2] value: 1
Set 2: Set 2:
4. WAP to find the Trace Enter the order of the sum of diagonal
(sum of the diagonal square matrix A: 3 values=15
elements) of a given m Enter the values of
xn matrix matrix A
345
689
134
Home Assignments (Book Exercises)
Q# Experiment Details
Day: 16
Set 1:
Enter the size of the Set 1:
array: 5 Before sorting elements of
Enter the elements the given array: 3 5 7 2 6
WAP to sort the
of the array: 3 5 7 2 After sorting elements of
elements of an 1-D
6 the given array: 2 3 5 6 7
array in ascending order
2. Set 2:
by using a suitable user
Set 2: Before sorting elements of
defined function for sort
Enter the size of the the given array: 5 0 -2
operation.
array: 3 After sorting elements of
Enter the elements the given array: -2 0 5
of the array: 5 0 -2
Set 1:
Set 1:
Enter the size of the
Largest element of array is
array: 5
7
Write a C program to Enter the elements
Smallest element of array
determine the largest of the array: 3 5 7 2
is 2
and smallest element of 6
3. a 1-D array. Use
Set 2:
functions LARGEST and Set 2:
Largest element of array is
SMALLEST for the given Enter the size of the
5
purpose. array: 3
Smallest element of array
Enter the elements
is -2
of the array: 5 0 -2
Day: 17
Lab Assignments
1. Set 2:
Enter the row and Set 2:
column size of the Sum of largest and
matrix: 5 3 smallest elements: 1
Enter the matrix:
5 6 2
4 3 0
-7 1 8
4 4 5
0 3 0
2. Write a C program to Set 1: Set 1:
swap the largest and Enter the row Entered matrix
smallest element of a and column 4562
2-D array of using a size of the 1930
function SWAP. matrix: 3 4 7 -2 1 8
Enter the
matrix: Matrix after swapping
4 5 6 2 4562
1 9 3 0 1 -2 3 0
7 -2 1 8 7918
Set 2:
Entered matrix
Set 2: 562
Enter the row 430
and column -7 1 8
size of the 445
matrix: 5 3 030
Enter the
matrix: Matrix after swapping
5 6 2 562
4 3 0 430
-7 1 8 8 1 -7
4 4 5 445
0 3 0 030
Day 18
Recursion
Lab Assignments
Set 2: Set 2:
Enter the size of the Entered Array: 5 0 -2
array: 3 Maximum elements of
Enter the elements of the given array: 5
the array: 5 0 -2
Home Assignments (Practice Problems)
Q# Experiment Details
Character Arrays/Strings
8. Write a program to count the Hello World H=1, e=1, l=3, o=2,
frequency of each character w=1, r=1, d=1
present in a string.
11. Write a C program to replace You are a very You are a very good
multiple occurrences of a very good boy boy
specific word present in a
given sentence with a single
occurrence.
Home Assignments (Practice Problems)
Q# Experiment Details
Set 2:
Enter the number of Set-2:
elements to store in the The elements in the
array: 6 array after sorting:
Enter 6 number of element - 1: 12
elements in the array: element - 2: 15
element - 1: 75 element - 3: 39
element - 2: 45 element - 4: 45
element - 3: 39 element - 5: 75
element - 4: 15 element - 6: 92
element - 5: 92
element - 6: 12
Set-2: Set-2:
Enter the total number Largest number is 56
of elements: 4
Number1: 8
Number2: 14
Number3: 56
Number4: 34
Set-2: Set-2:
Before changing - After changing -
value of a: 50 value of a: 60
Q# Experiment Details
Day: 25
Lab Assignments
Set-2
Enter Choice:
1. 12 hr format Set-2
2. 24 hr format
2 Difference between
Enter time1- Time 1 and Time 2
14:20:10 is-
Enter time2- 1 hrs 10 mins 5 secs
13:10:05
Set-2 Set-2
Enter an unsigned Individual bytes: 31
integer: 987654321 2D FB 3A
Q# Experiment Details
Set 1 Set 1
Input the word to search: a 3
Set 2 Set 2
Input the word to search: THE 1
3 WAP to count total Set 1 Set 1
number of words in Content of test.txt Paragraph -1 words
each paragraph in a From the small beginnings KIIT – 22
file test.txt has developed into a leading
university with a strong
interdisciplinary culture and a
commitment to teaching
excellence
Q# Experiment Details
Grading Policies:
Assessment Weightage /
Sl Internal/Sessional
No Component Marks
.
Continuous Evaluation 15
Pre-Mid
Lab Report + Attendance
Sem
Internal Viva/Quiz/Programming Test 15
1 (60
Post- Continuous Evaluation 15
Marks)
Mid Lab Report + Attendance
Sem Viva/Quiz/Programming Test 15
Quiz 20
2 Sessional
(40 Marks) Programming Test 20
Reference Materials:-
1. Text books
T1: Programming in ANSI C (8th Edition) by E. Balagurusamy
2. Reference books
https://onlinecourses.nptel.ac.in/noc22_cs40/preview