Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Week 1: Assignment Solution

1. CPU comprises of
a) ALU- Arithmetic and Logic Unit
b) Registers
c) Control unit
d) All of the above

Solution: (d)

2. Input device/s of a computer


a) Printer
b) Speaker
c) Joystick
d) Monitor

Solution: (c) Joystick

3. Choose the correct statements from the following


i) In high-level language, testing and debugging a program is difficult than assembly language.
ii) C programs are highly portable on any type of operating system platform.
iii) A flowchart is a visual representation of the sequence of steps for solving a problem.
iv) The role of a compiler is to translate source program statements to decimal codes.

a) (i) and (ii)


b) (ii) and (iii)
c) (i), (ii), and (iii)
d) (ii), (iii), and (iv)

Solution: (b) (ii) and (iii) are correct.

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.

4. How many bits are there in a byte?


a) 2
b) 4
c) 8
d) 16

Solution: (c) 1 Byte=8 bits

5. What will be the output of the flowchart given below?


Week 1: Assignment Solution

a) 4
b) 8
c) 16
d) 20

Solution: (c) b=a+b=5,b=a*b+ b/5=3*5 + 5/5=15 +1= 16

6. The output of the following algorithm is

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.

9. An interpreter reads the source code of a program


a) one line at a time
b) two line at a time
c) complete program in one stroke
d) None of these

Solution: (a) one line at a time.

10. Flowchart and algorithms are used for


a) Easy testing and debugging
b) Better programming
Week 1: Assignment Solution

c) Efficient coding
d) All of these

Solution: (d)

You might also like