National Institute of Technology, Tiruchirappalli - 15
Department of Computer Science and Engineering
CYCLE TEST I
CSIR 12 – INTRODUCTIONTO COMPUTER PROGRAMMING (THEORY)
Class / Semester : I MECH / II Time : 11.30 A.M to 12.30 P.M
Date : 25-05-2021 Marks: 15
Answer All Questions
1. List and explain the characteristics of computer (atleast eight). 2
2. Draw the flowchart to take a user input and find whether the number is odd 2
or even. If the number is odd find whether it is prime or not. If it is found
prime check whether it is a perfect number. Display at each stage. (Program
and algorithm not needed)
3. Write an algorithm to Reverse a given number and return true if it is the 2
same as the original number. (Program and flowchart not needed)
4. How exceptions are handled in python. List and brief any 6 built in 3
exceptions in python, give examples if needed
5. Write a program (alone) in python to display the pattern like right angle 2
triangle using an asterisk. Get the number of lines to be printed, from the
user.
The pattern be like : (it’s just an example don’t print only lines)
*
**
***
****
6. Let list = [’a’, ’b’, ’c’, ’d’, ’e’, ’f’]. Find 1
a) list[1:3] b) list[:4] c) list[3:]
7. Explain the concept in conditional statements, looping statements, and loop 3
control statements with relevant example