0% found this document useful (0 votes)
9 views

Practical File

The document describes 50 programs with different functions like calculating sums, areas, averages, determining even/odd, prime numbers etc. Each program specifies the inputs, outputs, and purpose in 1-2 sentences. The programs cover basic to intermediate level math and programming concepts.

Uploaded by

Antariksh Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Practical File

The document describes 50 programs with different functions like calculating sums, areas, averages, determining even/odd, prime numbers etc. Each program specifies the inputs, outputs, and purpose in 1-2 sentences. The programs cover basic to intermediate level math and programming concepts.

Uploaded by

Antariksh Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Program 1

A program to accept two integers and print their sum.


Input:

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:

End of Program 10~

Program 11
A program that accepts the length and breadth of a rectangle and print its area.
Input:

10
Output:

End of Program 11~

Program 12
A program that accepts the weight in Kg and height in meters and calculate its BMI.
Input:
11
Output:

End of Program 12~

Program 13
A program that reads the number n and print the values of n2, n3 and n4.
Input:

12
Output:

End of Program 13~

Program 14
A program to accept the marks in five subjects and calculate its average marks.
Input:
13
Output:

End of Program 14~

Program 15
A program that accepts the height in cm and converts it to feet and inches.
Input:
14
Output:

End of Program 15~

Program 16
A program that accepts the age and checks whether the person is eligible to vote or not.
Input:
15
Output:

End of Program 16~

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:

End of Program 17~

Program 18
A program that reads the base, width and height of a parallelogram and calculate its
area.
17
Input:

Output:

End of Program 18~

Program 19
A program to accept a year and check if it’s a leap year or not.
Input:
18
Output:

End of Program 19~

Program 20
A program to obtain x, y and z and calculate the value of 4x4 + 3y3 + 9z + 6π.
Input:
19
Output:

End of Program 20~

Program 21
A program to input a number and print its square if it’s odd, otherwise print its square
root.
20
Input:

Output:

End of Program 21~

Program 22
A program to input a number and check whether it is positive, negative or zero.
Input:

21
Output:

End of Program 22~

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:

End of Program 23~

Program 24
A program to enter a number and check whether it’s a prime number or not.
Input:

23
Output:

End of Program 24~

Program 25
A program to display a menu for calculating area of circle or perimeter of the circle.
Input:

24
Output:

End of Program 25~

Program 26
A program that reads two numbers and an arithmetic operator and displays the
computed result.
Input:
25
Output:

End of Program 26~


Program 27
A program to print whether a given character is an uppercase or lowercase character or
a digit or any other character.
Input:
26
Output:

End of Program 27~

Program 28
A program to calculate and print the roots of quadratic equation ax2 + bx + c = 0 (a ≠ 0).
Input:

27
Output:

End of Program 28~

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:

End of Program 29~

Program 30
A program to calculate the factorial of a number.
Input:

29
Output:

End of Program 30~

Program 31
A program to create a triange of stars using nested loop.
Input:

30
Output:

End of Program 31~

Program 32
A program to print Fibonacci series’ first 20 elements.
Input:

31
Output:

End of Program 32~

Program 33
A program to read an integer > 1000 and reverse the number.
Input:

32
Output:

End of Program 33~

Program 34
A program to input three angles and determine if they form a triangle or not.
Input:
33
Output:

End of Program 34~

Program 35
A program that displays first ten Mersenne numbers.
Input:
34
Output:

End of Program 35~

Program 36
A program that displays first ten Mersenne numbers and displays ‘Prime’ next to
Mersenne prime numbers.

35
Input:

Output:

End of Program 36~

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:

End of Program 37~

Program 38
A program to print the given pattern:
1
1 3
37
1 3 5
1 3 5 7
Input:

Output:

End of Program 38~

Program 39
A program to find the sum of the given series:
s = 1 + x + x2 + x3 + …+ xn
Input:

38
Output:

End of Program 39~

Program 40
A program to input two numbers and find their LCM and HCF.
Input:

39
Output:

End of Program 40~

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:

End of Program 41~

Program 42
A program to print the following using a single loop (no nested loops):
1
11
41
111
1111
11111
Input:

Output:

End of Program 42~

Program 43
A program to print a pattern like:
4321
432

42
43
4
Input:

Output:

End of Program 43~

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:

End of Program 44~

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:

End of Program 45~

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:

End of Program 46~

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:

End of Program 47~

Program 48
A program that reads a string and displays the longest substring of the given string
having just the consonants.
Input:

47
Output:

End of Program 48~

Program 49
A program that reads a string and then prints a string that capitalizes every other letter
in the string.
Input:

48
Output:

End of Program 49~

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:

End of Program 50~


______________________________________________________________________

50

You might also like