0% found this document useful (0 votes)
75 views

Assignment 1 July 2022 Solution

The document provides solutions to a week 1 coding assignment. It answers 10 multiple choice questions about topics like: 1) The ASCII standard for character to number conversion. 2) C programs having sequential execution. 3) A flowchart being a visual representation of problem steps.

Uploaded by

Subanandhini S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Assignment 1 July 2022 Solution

The document provides solutions to a week 1 coding assignment. It answers 10 multiple choice questions about topics like: 1) The ASCII standard for character to number conversion. 2) C programs having sequential execution. 3) A flowchart being a visual representation of problem steps.

Uploaded by

Subanandhini S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Week 1 Assignment Solution

1. The input given from keyboard is converted to computer understandable unit (bit) by the standard
a) ISO
b) ANSI
c) ASCII
d) EBCDIC

Solution: (c) ASCII is the standard for character to equivalent number (in bits) conversion.

2. The execution nature of C program is


a) Event-based
b) Concurrent
c) Multi-threaded
d) Sequential

Solution: (d) Sequential

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. When we write X=Y in C, which of the following statements is valid?


a) X and Y both have same values but different locations.
b) X and Y both have same location and same values.
c) X and Y have different values and same location.
d) X and Y have different values and different locations.

Solution: (a) X and Y both have same values but different locations.

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
Week 1 Assignment Solution

d) 40

Solution: (b) The flowchart finds the sum of first 7 natural numbers. Hence, the right answer is 28.

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


Week 1 Assignment Solution

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. The C language has been developed at


a) IBM, USA
b) Borland International, USA
c) Sun Microsystems
d) AT & T Bell Labs, USA

Solution: (d) AT & T Bell Labs, USA

You might also like