COMPUTER PROGRAMMING FUNDAMENTALS
WHAT IS PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
IF-OTHERWISE
|
|
IF-ELSE
|
|
DO-ELSE
|
|
None of the above
|
Detailed explanation-1: -Use if to specify a block of code to be executed, if a specified condition is true. Use else to specify a block of code to be executed, if the same condition is false. Use else if to specify a new condition to test, if the first condition is false. Use switch to specify many alternative blocks of code to be executed.
Detailed explanation-2: -An if statement is a selection statement that allows more than one possible flow of control. An if statement lets you conditionally process a statement when the specified test expression, implicitly converted to bool, evaluates to true . If the implicit conversion to bool fails the program is ill-formed.
Detailed explanation-3: -The two-way selection is the basic decision statement for computers. The decision is based on resolving a binary expression, and then executing a set of commands depending on whether the response was true or false. C, like most contemporary programming languages, implements two-way selection with the if…else statement.
Detailed explanation-4: -Nested if is a decision-making statement that works similar to other decision-making statements such as if, else, if..else, etc. It executes a block of code if the condition written within the if statement is true. However, in the nested-if statement, the block of code is placed inside another if block.