Practical File
Practical File
Output:
End of Program 1~
1
Program 2
A program that accepts radius of a circle and print its area.
Input:
Output:
End of Program 2~
Program 3
2
A program that accepts height and base of a triangle and then calculate its area.
Input:
Output:
End of Program 3~
Program 4
3
A program that inputs a student’s marks in three subjects (out of 100) and print the
percentage marks.
Input:
Output:
End of Program 4~
Program 5
A program that computes the area of a square and a triangle.
4
Input:
Output:
End of Program 5~
Program 6
A program to calculate simple interest.
5
Input:
Output:
End of Program 6~
Program 7
A program to read two numbers and print their quotient and remainder.
6
Input:
Output:
End of Program 7~
Program 8
A program to find whether the given number is odd or even.
Input:
7
Output:
End of Program 8~
Program 9
A program to find the largest number among the given three numbers.
Input:
8
Output:
End of Program 9~
Program 10
A program to find the lowest number among the given three numbers.
Input:
9
Output:
Program 11
A program that accepts the length and breadth of a rectangle and print its area.
Input:
10
Output:
Program 12
A program that accepts the weight in Kg and height in meters and calculate its BMI.
Input:
11
Output:
Program 13
A program that reads the number n and print the values of n2, n3 and n4.
Input:
12
Output:
Program 14
A program to accept the marks in five subjects and calculate its average marks.
Input:
13
Output:
Program 15
A program that accepts the height in cm and converts it to feet and inches.
Input:
14
Output:
Program 16
A program that accepts the age and checks whether the person is eligible to vote or not.
Input:
15
Output:
Program 17
A program that inputs two numbers and check whether the first number is fully divisible
by the second number or not.
16
Input:
Output:
Program 18
A program that reads the base, width and height of a parallelogram and calculate its
area.
17
Input:
Output:
Program 19
A program to accept a year and check if it’s a leap year or not.
Input:
18
Output:
Program 20
A program to obtain x, y and z and calculate the value of 4x4 + 3y3 + 9z + 6π.
Input:
19
Output:
Program 21
A program to input a number and print its square if it’s odd, otherwise print its square
root.
20
Input:
Output:
Program 22
A program to input a number and check whether it is positive, negative or zero.
Input:
21
Output:
Program 23
A program to input percentage marks of a student and find the grade as per following
criterion:
Marks Grade
22
>=90 A
75-90 B
60-75 C
Below 60 D
Input:
Output:
Program 24
A program to enter a number and check whether it’s a prime number or not.
Input:
23
Output:
Program 25
A program to display a menu for calculating area of circle or perimeter of the circle.
Input:
24
Output:
Program 26
A program that reads two numbers and an arithmetic operator and displays the
computed result.
Input:
25
Output:
Program 28
A program to calculate and print the roots of quadratic equation ax2 + bx + c = 0 (a ≠ 0).
Input:
27
Output:
Program 29
A program to print sum of natural numbers between 1 to 7. Print the sum progressively,
i.e., after adding each natural number, print sum so far.
28
Input:
Output:
Program 30
A program to calculate the factorial of a number.
Input:
29
Output:
Program 31
A program to create a triange of stars using nested loop.
Input:
30
Output:
Program 32
A program to print Fibonacci series’ first 20 elements.
Input:
31
Output:
Program 33
A program to read an integer > 1000 and reverse the number.
Input:
32
Output:
Program 34
A program to input three angles and determine if they form a triangle or not.
Input:
33
Output:
Program 35
A program that displays first ten Mersenne numbers.
Input:
34
Output:
Program 36
A program that displays first ten Mersenne numbers and displays ‘Prime’ next to
Mersenne prime numbers.
35
Input:
Output:
Program 37
A program to calculate the BMI and print the nutritional status as per the following
table:
36
Nutritional Status WHO criteria BMI cut-off
Underweight < 18.5
Normal 18.5 – 24.9
Overweight 25 – 29.9
Obese ≥ 30
Input:
Output:
Program 38
A program to print the given pattern:
1
1 3
37
1 3 5
1 3 5 7
Input:
Output:
Program 39
A program to find the sum of the given series:
s = 1 + x + x2 + x3 + …+ xn
Input:
38
Output:
Program 40
A program to input two numbers and find their LCM and HCF.
Input:
39
Output:
Program 41
A program to calculate the sum of the given series:
s = (1) + (1+2) + (1+2+3) +…+ (1+2+3+…+n)
40
Input:
Output:
Program 42
A program to print the following using a single loop (no nested loops):
1
11
41
111
1111
11111
Input:
Output:
Program 43
A program to print a pattern like:
4321
432
42
43
4
Input:
Output:
Program 44
A program that reads a line and prints its statistics like:
Number of uppercase letters: Number of lowercase letters:
Number of alphabets: Number of digits:
Input:
43
Output:
Program 45
A program that reads a line and a substring and display the number of occurrences of
the given substring in the line.
Input:
44
Output:
Program 46
A program that takes a string with multiple words and then capitalizes the first letter of
each word and forms a new string out of it.
Input:
45
Output:
Program 47
A program that reads a string and checks whether it is a palindrome string or not
without using string slice.
Input:
46
Output:
Program 48
A program that reads a string and displays the longest substring of the given string
having just the consonants.
Input:
47
Output:
Program 49
A program that reads a string and then prints a string that capitalizes every other letter
in the string.
Input:
48
Output:
Program 50
A program that reads email-id of a person in the form of a string and ensures that it
belongs to domain @edupillar.com. (Assumption: No invalid characters are there in
email-id).
Input:
49
Output:
50