FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What do the statements ‘if’ and ‘else’ do?
A
a decision
B
a loop
C
a delay
D
None of the above
Explanation: 

Detailed explanation-1: -In an if statement a logical test is made which can evaluate to either true or false. If the result of the test is true, the statements in the if branch are executed. If the result of the test is false, the statements in the else branch are executed.

Detailed explanation-2: -Definition and Usage The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed.

Detailed explanation-3: -The if statement is a decision-making structure that consists of an expression followed by one or more statements. The if else is a decision-making structure in which the if statement can be followed by an optional else statement that executes when the expression is false.

Detailed explanation-4: -If statement is the basic decision-making statement that tells the compiler to execute a code block only if the condition is true.

There is 1 question to complete.