COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Else
A
To provide a response if a statement is not met
B
To provide a response if a statement is met
C
A loop with a condition set at the start
D
Used in a question as part of the decision process
Explanation: 

Detailed explanation-1: -If you require code to run only when the statement returns true (and do nothing else if false) then an else statement is not needed. On the other hand if you need a code to execute “A” when true and “B” when false, then you can use the if / else statement.

Detailed explanation-2: -The WHILE statement is used to execute one or more statements repeatedly until a condition is met. WHILE statements are used to execute a statement repeatedly while a condition remains true.

Detailed explanation-3: -if (score >= 90) grade = ‘A’; The following example displays Number is positive if the value of number is greater than or equal to 0 . If the value of number is less than 0, it displays Number is negative . if (number >= 0) printf("Number is positive"); else printf("Number is negative");

There is 1 question to complete.