COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
You have written a program that asks the user for a number and then multiplies the number by 2 ten times before the program ends. Which type of control structure is this?
A
Functional
B
Loop
C
Selection
D
Sequence
Explanation: 

Detailed explanation-1: -A selection structure, also called an “If-Then-Else” structure, is flowcharted as follows: After either the true set of actions or the false set of actions are taken, program control resumes with the next statement (the statement that would be placed below the connector in the flowchart above).

Detailed explanation-2: -A binary code represents text, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often “0” and “1” from the binary number system. The binary code assigns a pattern of binary digits, also known as bits, to each character, instruction, etc.

Detailed explanation-3: -"Iteration"; a statement or block is executed until the program reaches a certain state, or operations have been applied to every element of a collection. This is usually expressed with keywords such as while, repeat, for or do..

There is 1 question to complete.