Professional Documents
Culture Documents
11 CS Hy Pract Ques
11 CS Hy Pract Ques
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 ……,,
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)
#
##
###
####
#####
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
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
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