Computer Science
Subject Code: - 083
Practical File
Submitted by Submitted to
Name: Ankita Kumari Ms. Shilpi Chauhan
Malik
Class: XII A PGT – Computer
Science
Roll No: 12107
Board Roll
No :
ACKNOWLEDGEMENT
I would like to convey my heartful thanks to Ms. Shilpi Chauhan Malik, my
Computer Science teacher who always gave me valuable suggestions and
guidelines during the completion of this file.
She has been a source of inspiration during the completion of my practical
work. She helped me to understand and remember the important details of
the practical file that I would have otherwise lost.
My practical file has been successfully completed only because of her guidance
Teacher’s signature
Certificate
This is to certify that, Ankita Kumari student of class XII –A has successfully completed the
Informatics Practices (Code no. 065) practical file under my guidance.
Subject teacher:
Ms. Shilpi Chauhan Malik
INDEX
S. Experiment Page
Title of experiment
No No. No.
Write a program that takes a year as an input from the
1 Program No 1 4
user and checks whether the given year is a leap year
or not.
2 Program No 2 Write a program that accepts a digit as an input from the 5
user. If the digit is a positive number (1-9), then display it in
words; otherwise, display the message, “error: A positive
digit is expected and less than 10”.
3 Program No 3 Write a program that accepts three colors from the user. If 6
the user enters orange, white and green, respectively, the
message “Indian Flag” is displayed, otherwise, the message
“Not an Indian Flag “is displayed
4 Program No 4 Write a program to accept two numbers and print all prime 7
numbers between those two numbers.
5 Program No 5 Write a program to check whether a number is a palindrome 8
or not.
Program No: - 1
1. Write a program that takes a year as an input from the user
and checks whether the given year is a leap year or not.
Sol:-
Code
Output
Program No: - 2
2. Write a program that accepts a digit as an input from the
user. If the digit is a positive number (1-9), then display it in
words; otherwise, display the message, “error: A positive
digit is expected and less than 10”.
Sol:-
Code
Output:-
Program No: - 3
3. Write a program that accepts three colours from the user. If
the user enters orange, white and green, respectively, the
message “Indian Flag” is displayed, otherwise, the message
“Not an Indian Flag “is displayed.
Sol:-
Code:-
Output:-
Program No: - 4
4. Write a program to accept two numbers and print all prime
numbers between those two numbers.
Code:-
Output:-
Program No: - 5
5. Write a program to check whether a number is a palindrome or
not.
Code:-
Output:-