Assignment
Assignment
1. CPU comprises of
a) ALU- Arithmetic and Logic Unit
b) Registers
c) Control unit
d) All of the above
Solution: (d)
In high-level language, testing and debugging a program is easier than assembly language.
The role of a compiler is to translate source program statements to object codes.
a) 4
b) 8
c) 16
d) 20
a) 21
b) 28
c) 30
d) 40
Solution: (b) The flowchart finds the sum of first 7 natural numbers. Hence, the right answer is 28.
Week 1: Assignment Solution
7. The print values of ‘a’ and ‘b’ of the flowchart below are
a) a=4,b=6
b) a=6,b=4
c) a=10,b=2
d) a=2,b=10
Solution: (b) The algorithm finds the swap of two numbers. Hence, the output is a=6, b=4
8. The program which translates high level program into its equivalent machine language program is
called
a) a translator
b) a language processor
c) a converter
d) None of the above
Solution: (a) translator. Generally, there are three types of translator-compilers, interpreters, assemblers.
c) Efficient coding
d) All of these
Solution: (d)