FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is an if/else loop
A
executes a block of code if a specified condition is true. If the condition is false, it will stop
B
executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed
C
executes a block of code if a specified condition is true. If the condition is true, another block of code can be executed
D
None of the above
Explanation: 

Detailed explanation-1: -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. The if/else statement is a part of JavaScript’s “Conditional” Statements, which are used to perform different actions based on different conditions.

Detailed explanation-2: -Use the if statement to specify a block of code to be executed if a condition is true .

Detailed explanation-3: -The if-else statement is used to execute both the true part and the false part of a given condition. If the condition is true, the if block code is executed and if the condition is false, the else block code is executed.

Detailed explanation-4: -If the condition is False, the code block indented below the else statement will be executed, and the code block indented below the if statement will be skipped.

Detailed explanation-5: -Python if statement evaluates a boolean expression to true or false, if the condition is true then the statement inside the if block will be executed in case if the condition is false then the statement present inside the else block will be executed only if you have written the else block otherwise it will do nothing.

There is 1 question to complete.