# 12th Class Computer Chapter 4 Choices and Decisions Short Questions Answer

## 12th Class Computer Chapter 4 Choices and Decisions Short Questions Answer

What is the importance of decision-making?

Decision making is very important in any kind of programming. It would not be possible to solve most problems without the ability to alter the sequence of instructions in a program based on the result of comparing data values.

Write down the statements which “C” uses to implement choices and decisions in programs?

“C” uses the following statements to implement choices and decisions in programs.
I. The if statement
II. The if else statement
III. The else-if statement
IV. The switch statement
V. “?” the conditional operator

Define the IF statement?

This statement allows our program to execute a single statement or a block of statements enclosed between braces, if a given condition is true.

Write down the general form of the IF statements?

IF statement has the general form if (condition)
{block of statements}

For which purpose the IF-ELSE statement is used?

The if statement executes a statement if the condition specified is true. Program execution then continues with the next statement in sequence. It might be that we want to execute a particular statement or block of statements only when the condition is false. To cater to this, the if else statement is used.

Define the IF-ELSE statement?

It has an extension of the IF that allows one course of action to be followed if the condition is true and another to be executed if the condition is false. Execution then continues with the next statement in sequence.

Write down the general form of the IF-ELSE statement?

IF-ELSE statement has the following general form: if (condition)
{block of statement}
Else
{block of statements}

What is meant by “get”, “ch” and “e” in getche ( ) function?

The “get” means it gets something from an input device. The “ch” means it gets a character and the “e” means it echoes the character to the screen when you type it.

When the ELSE-IF statement is used?

This statement is very useful in programming when we have more than two actions to be taken based on different conditions.

What is the difference between the switch statement and the else-if statement?

The switch statement is very similar to the else-if statement but it has more flexibility and it is easy to use.

What is the function of switch statement?

The switch statement enables us to select from multiple choices on a set of fixed values for a given expression.

What is the type of the conditional operator?

A conditional operator is a decision-making operator.

Why the “?” conditional operator is called the ternary operator?

The “?” conditional operator is sometimes called the ternary operator because it involves three operands and is the only operator to do so.

Differentiate between the IF-else statement and the “?” conditional operator.

The if-else statement provides a way of selecting one of the two statements to be executed, the “?” conditional operator is a way to choose between two values.

Write down the general form of the “?” conditional operator?

The general form of the conditional operator is condition? Expression 1: Expression 2.

Write down the quadratic equation if a,b,c are coefficients and x is a variable.

The quadratic equation is ax² + bx + c = 0

Which formula is used to find the solution of ax² + bx + c = 0

The formula for the solution of ax² + bx + c = 0 is
x = – b±√b²– 4ac/2a

If √b²– 4ac = 0 then what will be the solution.

If √b²– 4ac = 0 then there is only one real solution.

If √b²– 4ac > 0 then what will be the solution.

If √b²– 4ac > 0 then there are two real solution.

If √b²– 4ac < 0 then what will be the solution.

If √b²– 4ac < 0 then print the message “no real solution”.

You Can Learn and Gain more Knowledge through our Online Quiz and Testing system Just Search your desired Preparation subject at Gotest.
error: