Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

MILESTONE ACADEMY

CLASS XI
COMPUTER SCIENCE half yearly PRACTICAL QUESTIONS

1. Write a program to input length of three sides of a triangle. Then check if these
sides will form a triangle or not.
(Rule is: a+b>c;b+c>a;c+a>b)

2A year is a leap year if it is divisible by 4, except that years divisible by 100 are not leap
years unless they are also divisible by 400. Write a program that asks the user for a year
and prints out whether it is a leap year or not.

3.Write a program that reads a string and checks whether it is a Palindrome String or not?.
3
4write a program to print Fibonacci series first 20 elements . Some initial elements of a Fibonacci
series are:0 1 1 2 3 5 8 ……,,

5)Write a program to print whether a given character is an uppercase or a lowercase


character or a digit or any other character.

6.Write a program to accept three integers and print largest of the three. 5
7. Write a program to input 3 sides of a triangle and print whether it is an equilateral,
scalene or isosceles triangle.
8.Write a program to calculate simple interest.
9.Write a program to calculate amount payable after compound interest
(amt = p * (1 + r / 100) ** t)

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


11.Write a program to calculate the radius of a sphere whose area (4πr2) is given.

12) Write a program to find sum of the series: s=1+x+x2+x3+…..+xn.

13.I) Write a program that prints the following patterns .

#
##
###
####
#####
ii)Write a program to print a pattern like:

4321
432
43
4

.
III)Write programs using nested loops to produce the following patterns:
A
AB
ABC
ABCD
ABCDE
ABCDEF

ii)Write programs using nested loops to produce the following patterns:


A
BB
CCC
DDDD
EEEEE

14. Write a program which takes two inputs one is a sting and other is a character. The
function should create new string after deleting all occurrences of the character from the
string and return the new string.

15.Input a string having some digits. Write a program to calculate the sum of digits present in this
string.
(sumita arora pgno-363)
16.Write 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:
Number of symbols:

17.Write a program to find the grade of a student when grades are allocated as given in the
table below

Percentage of marks Grade


Above 90% A
80% to 90% B
70% to 80% C
60% to 70% D
Below 60% E

18.Write a program which replaces all vowels in the string with “*”

19.Write a program which reverses a string and stores the reversed string in a new string.
Solution

20.Write a program to check whether a number is prime or not

You might also like