COMPUTER FUNDAMENTALS

COMPUTER SOFTWARE

PROGRAMMING LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
While
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: -Loop with condition on the beginning: while, while end while, do while loop, while do, while wend. Condition testing is done at the beginning of the loop. before each iteration the condition is tested, if it is was true.

Detailed explanation-2: -A “While” Loop is used to repeat a specific block of code an unknown number of times, until a condition is met. For example, if we want to ask a user for a number between 1 and 10, we don’t know how many times the user may enter a larger number, so we keep asking “while the number is not between 1 and 10".

Detailed explanation-3: -The while loop starts by evaluating condition . If condition evaluates to true, the code in the code block gets executed. If condition evaluates to false, the code in the code block is not executed and the loop ends.

Detailed explanation-4: -It is set to zero (called initialization) before entering the while loop structure and as long as it is less than 5 (five); the loop action will be executed. But part of the loop action uses the increment operator to increase counter’s value by one.

There is 1 question to complete.