Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
280 views

Python MCQ - Basics

This document contains questions related to algorithms, programming concepts, and flowcharts. It asks about topics like pseudocode syntax, program translation, complexity analysis, control structures, and problem solving approaches. Multiple choice questions cover concepts such as compilers, interpreters, recursion, sorting algorithms, and Tower of Hanoi solutions.

Uploaded by

malarvizhi k
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
280 views

Python MCQ - Basics

This document contains questions related to algorithms, programming concepts, and flowcharts. It asks about topics like pseudocode syntax, program translation, complexity analysis, control structures, and problem solving approaches. Multiple choice questions cover concepts such as compilers, interpreters, recursion, sorting algorithms, and Tower of Hanoi solutions.

Uploaded by

malarvizhi k
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1.

When an algorithm is written in the form of a programming language, it becomes CO1/U


a
a. Flowchart
b. Program
c. Pseudo code
d. Syntax

2. The Terminal Symbol is denoted by CO1/R


a.
b.

c.
d.
3. Software that translates and executes a high level language program in one line CO1/R
at a time is known as
a. a Compiler
b. an Interpreter
c. an Assembler
d. an Executor

4. Choose a Symbol that can represent two different conditions________ CO1/U


a.
b.
c.
d.

5. Which of the following is not an advantage of a flowchart? CO1/R


a. better communication
b. efficient coding
c. systematic testing
d. improper documentation

6. A is a diagram that depicts the flow of a program. CO1/R


a. Algorithm
b. Hash Table
c. Graph
d. Flowchart

7. What type of structure is this? CO1/U

a. sequence
b. case
c. repetition
d. process

8. Which symbol is used to represent command in Pseudocode CO1/R


a. //:
b. :
c. “””
d. ??

9. ________ is used to show hierarchy in a pseudo code. CO1/R


a. Indentation
b. Curly Braces
c. Round Brackets
d. Semicolon

10. In which of the following only one flow line is used ? CO1/U
a. Process
b. Terminal
c. Decision Making
d. I/O

11. The language made up of binary coded instruction is_______ CO1/R


a. Machine
b. C
c. BASIC
d. High level

12. The time complexity of the solution tower of hanoi problem using recursion is CO1/R
_________
a. O(n2)
b. O(2n)
c. O(n log n)
d. O(n)

13. When writing a computer program most programmers use? CO1/R


a. A high level language
b. A low level language
c. A machine code
d. An algorithm

14. Resolving errors in a program is known as... CO1/R


a. Debugging
b. Refixing
c. Error Checking
d. Problem Solving

15. Minimum number of moves required to solve a tower of hanoi problem with n CO1/U
disks is __________
a. 2n
b. 2n-1
c. n2
d. n2-1

16. The two categories of low level language are... CO1/R


a. Machine Code & Assembly
b. Machine Code & Algorithms
c. Assembly & Algorithms
d. Algorithms & Binary

17. What is the name for the software used to convert an assembly language CO1/R
program into machine code?
a. Assembler
b. Interpreter
c. Compiler
d. Translator

18. Suppose a list has values [3,4,5,67,78] then what is the index value of 5 CO1/U
a. 2
b. 3
c. 4
d. 1

19. Which of the following is used to represents the information entering or leaving CO1/U
the system?
e. Decision
f. Subfuncion
g. Initialization
h. I/O

20. Keep the statement language ______________ while writing a pseudo code. CO1/R
Fill in the blank with suitable choice.
a. dependent
b. independent
c. case sensitive
d. capitalized

21. A statement used to close the IF block is_______ CO1/R


a. ELSE
b. ELSEIF
c. END
d. ENDIF

22. Choose the correct extension of the Python file. CO1/U


a. .py
b. .python
c. .p
d. .c

23. Control flow executed in --------------ways. CO1/U


a. 2
b. 3
c. 4
d. 5

24. Which of the following is the use of ‘function’ in python? CO1/R


a. Functions are reusable pieces of programs
b. Functions don’t provide better modularity for your application
c. Function can’t return data as a result
d. All of the mentioned
CO1/R
25. Which of the following was invented by the Persian mathematician Abu Ja’far
Mohammed ibn-i Musa al Khowarizmi.
a. Flowchart
b. Flow
c. Algorithm
d. Syntax
CO1/R
26. The process of drawing a ‘Diagram’ for an algorithm is called __________.
a. Performance
b. Evaluation
c. Algorithmic Representation
d. Flowchart
CO1/U
27. In a “Guess an Integer Number in a Range” problem which approach is the best ?
a. Linear search
b. Binary search
c. Sequential search
d. Interpolation search
CO1/U
28. The statement that demands the computer to get a value from an input device
and store it in a memory location in Pseudocode is
a. read
b. write
c. READ
d. WRITE
CO1/R
29. Which is the most appropriate definition for recursion?
a. Function that calls itself

b. Function execution instance that calls another execution instance of the


same function
c. Class method that calls another class method

d. Inbuilt method that is automatically called


CO1/R
30. In Tower of Hanoi problem how many disk can be moved among the towers at a
time?
a. 4
b. 2
c. 3
d. 1

BEGIN CO1/A
31.
GET n
INITIALIZE i=1
-------------
-------------
-------------
ENDWHILE
END
In this Pseudocode which finds the square of a number,choose the correct
missed statements.
a. WHILE(i<=n) DO
PRINT i*i*i
i=i+2
b. WHILE(i<=n) DO
PRINT i*i
i=i+2
c. WHILE(i>=n) DO
PRINT i*i
i=i+2
d. WHILE(i<=n) DO
PRINT i*i
i=i+1

CO1/A
32. Minimum time required to solve Tower of Hanoi puzzle with 4 disks will be
__________ (assuming that one move takes 2 seconds)
a. 15 seconds
b. 30 seconds
c. 16 seconds
d. 32 seconds
CO1/A
33. Choose the condition which is used to prove n = 7 is an positive number .
a. if(n< 0)
b. if(n>=0)
c. if(n>0)
d. if(n==0)
CO1/A
34. Choose the condition which is used to prove num=6 is an even number.
a. if(num%2==0)
b. if(num/2==0)
c. if(num%2=0)
d. if(num%2!=0)
CO1/A
35. Choose the output of this Program.
age=20
If(age>=18):
print(“eligible for voting”)
else:
print(“not eligible for voting”)

a. Eligible For Voting


b. not eligible for voting
c. Compiler Error
d. eligible for voting
Calculate the area of circle if the radius is 4? CO1/A
36.
a. 50.24
b. 50.25
c. 50.75
d. 50.89
CO1/A
37. Calculate the Simple interest for the following values.
Principle amount =Rs.5000
No of years= 4
Rate of interest =6
a . Rs.1200
b. Rs.1100
c. Rs.1000
d. Rs.1300
CO1/A
38. BEGIN
GET n
INITIALIZE i=1
FOR (i<=n) DO
PRINT i
i=i+1
ENDFOR
END
Choose the expected output for the above pseudocode.Here n=5.
a. 1,2,3,4
b. 1,2,3,4,5
c. 1,2,3,4,5,6
d. 0,1,2,3,4,5
CO1/A
39. Choose the list of symbols used to draw the flowchart to check Greatest of three
numbers
a. Terminal,Flow line,Input/ output,Decision making
b. Terminal,Flow line,Input/output
c. Terminal, Input/ output,Decision making
d. Terminal ,Process,Flow line,Input/ output,Decision making
CO1/A
40. Find the factorial of a given number n=5.
a. 120
b. 25
c. 150
d. 220
CO1/A
41. Given the Algorithm,
READ total number of element in the List as N
READ first element as E
SET MIN =E
SET i=2
WHILE i<=n
READ ith element as E
IF E < MIN THEN
SET MIN = E
ENDIF
INCREMENT i by ONE
ENDWHILE
PRINT MIN

How will you change the above algorithm to find Maximum element in a List?
a. SET MAX = E
b. IF E > MIN THEN
c. IF E < MAX THEN
d. INCREMENT i by TWO

CO1/A
42. “Guess an Integer Number in a Range” Problem the Range value is 1 to 100.
How many guesses it takes to find the guessed number?
a. 8
b. 7
c. 4
d. 10
CO1/A
43.

Find the Output of this Flowchart n=10.


a. 1,3,5,7,9
b. 1,3,5,7,9,11
c. 3,5,7,9
d. 0,3,5,7,9
CO1/A
44.

Find the Output of this Flowchart n=3.


a. 1,8,27
b. 1,9,27
c. 0,8,27
d. 1,8

45. In Tower of Hanoi problem,if the Number of disks=4 then how many moves it CO1/A
needed?
a. 8
b. 4
c. 15
d. 16

You might also like