0% found this document useful (0 votes)
28 views17 pages

Cs Practicals For Finals

The document contains a list of programming tasks that cover various basic programming concepts such as arithmetic operations, area calculations, conditional statements, loops, string manipulation, and data structures. Each task specifies a particular problem to solve using programming, including calculating areas, checking for prime numbers, and manipulating lists and strings. The tasks are designed to help learners practice and enhance their programming skills.

Uploaded by

daddy69163
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)
28 views17 pages

Cs Practicals For Finals

The document contains a list of programming tasks that cover various basic programming concepts such as arithmetic operations, area calculations, conditional statements, loops, string manipulation, and data structures. Each task specifies a particular problem to solve using programming, including calculating areas, checking for prime numbers, and manipulating lists and strings. The tasks are designed to help learners practice and enhance their programming skills.

Uploaded by

daddy69163
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/ 17

1.

Write a program to accepts two integers and print their


sum.

2. Write a program that accepts the radius of a circle and


prints its area.

3. Write a program that accepts base and height and


calculate the area of a triangle.

4.Write a program that inputs a student’s marks in three


subjects (out of 100) and prints the percentage marks.

5. Write a program to compute the area of square and


triangle.

6. Write a program to calculate simple interest.


7. Write a program to read two numbers and prints their
quotient and remainder.

8. Write a program to find whether a given number is even


or odd.

9. Write a program to find the largest among the three


integers.

10. Write a program to find the lowest among the three


integers.
11. Write a program that accepts the length and
breadth of the rectangle and calculate its area.

12. Write a program that accepts weight in Kg and height in


meters and calculate the BMI.

13. Write a program that reads the number n and prints the
value of n2, n3 and n4.

14. Write a program to accept the marks of five subjects


and calculate the average marks.
15. Write a program to accept the height in cm and convert
it into feet and inches

16. Write a program that accepts the age and print if one is
eligible to vote or not.

17. Write a program that accepts two numbers and check if


the first number is fully divisible by the second number or
not.

18. Write a program to read base, width and height of


parallelogram and calculate its area and perimeter.
19. Write a program to accept the year and check if it is a
leap year or not.

20. Write a program to obtain x, y, z and calculate


4x4+3y3+9z+6π.

21. Write a program to input a number and print its square


if it is odd, otherwise print its square root.

22. Write a program to input a number and check whether it


is positive, negative or zero.

23. Write a program to input percentage marks of a student


and find the grade as per the following criterion:
'''
program to input percentage marks of a student and
find the grade as per following criterion:
Marks Grade
>=90 A
75-90 B
60-75 C
Below 60 D

24. Write a program to enter a number and check if it is a


prime number or not.

25. Write a program to display a menu for calculating the


area of the circle or perimeter of the circle.

26. Write a program that reads two numbers and an


arithmetic operator and displays the computed result.
27. Write a program to print whether a given character is an
uppercase or a lowercase character or a digit or any other
character.

28. Write a program to calculate and print the roots of a


quadratic equation ax2+bx+c=0.(a≠0)
29. Write a program to print the sum of natural numbers
between 1 to 7. Print the sum progressively i.e. after adding
each natural number, print sum so far.

30. Write a program to calculate the factorial of a number.

31. Write a program to create a triangle of stars using a


nested loop.

32. Write a Python script to print Fibonacci series’ for first


10 elements.
33. Write a program to read an integer>1000 and reverse
the number.

34. Input three angles and determine if they form a triangle


or not.

35. Write a Python script that displays the first ten


Mersenne numbers.

36. Write a Python script that displays the first ten


Mersenne numbers and displays ‘Prime’ next to Mersenne
Prime Numbers.
37. Write a program to calculate BMI and print the
nutritional status as per the following table:

38. Write a python script to print the following pattern.


1
11
1 1 11 1 1 1

39. Write a program to find the sum of the series:


s=1+x+x 2+x 3+x 4...+x n

40. Write a python script to input two numbers and print


their LCM and HCF.

41. Write a python script to calculate the sum of the


following series:
S=(1)+(1+2)+(1+2+3)+......+(1+2+3+....+n)

43. Write a program to print a pattern like:


4321
432
43
4
44. A program that reads a line and prints its statistics like:
 The number of uppercase letters:
 The number of lowercase letters:
 The number of alphabets:
 The number of digits:

45. Write a program that reads a line and a substring and


displays the number of occurrences of the given substring in
the line.
46. Write 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.

47. Write a program that reads a string and checks whether


it is a palindrome string or not.

48. Write a program that reads a string and displays the


longest substring of the given string having just the
consonants.
49. Write a program that reads a string and then prints a
string that capitalizes every other letter in the string.

50. Write a program that reads the email id of a person in


the form of a string and ensures that it belongs to domain
@brilliant-academy.ac.in (Assumption: no invalid characters
are there in email-id)

51. WAP to remove all odd numbers from the given list.
L= [2, 7,12, 5,10,15,23]
52. WAP to display the second largest element of a given
list.

53. WAP to display frequencies of all the elements of a list.

54. WAP in Python to find and display the sum of all thevalues which are
ending with 3 from a list.

55. WAP to search an element from the given list.


56. WAP to accept values from user and create a tuple.

57. Write a program to input the total number of sections


and stream name in 11th class and display all information
on the output screen.

58. Write a program to input the total number of sections


and stream name in class 11th and to display all the details.

59. WAP to store students’ details like admission number,


roll number, name and percentage in a dictionary and
display information on the basis of admission number.
60. Write a Python program to remove an item from a tuple.

61. Write a program to input n numbers from the user.


Store these numbers in a tuple. Print the maximum,
minimum, sum and mean of numbers from this tuple.

You might also like