Computer Science, asked by Raaj1715, 1 year ago

What are conditional control structures of 0?

Answers

Answered by isaac22
1
A condition in which answer is in true or false that is in boolean is called conditional control structure
Answered by kavitasingh1234
2

Answer:

Conditional control structure:-

They are the set of statements which results in single condition .if,if-else ,if -else-if,nested if.

if -else statement:-

  • They are similar to if statement .
  • Every condition will always result in either true or false value .
  • The if -else consists of 2 set of statements:-
  1. The block statement following the if condition is executed only if the condition is true.
  2. If the statement is false the statement follows the else .

note

only one condition is executed in the statement.

Syntax:

if(condition)

Statement;

else

Statement;

Example:

if (a>b)

System.out.println ( "a is greater");

else

System. out.println(" b is greater");

If there is more than a single statement under if or else then a block will have to be formed by using curly braces {}.

Syntax:

if(conditions)

{

Statement;

}

else

{

Statement;

}

Characters can also be used in the condition ,enclosed within single quotes.

Example:

if(reply=='Y')

System.out.println ("Answer is Yes");

if (ch>='A' && ch<='Z')

System.out. println ("Upper case letter");

Any condition can be joined together with the help of logical operators.

Example:

if(marks>=60)&&(mark<75)

System.out.println("First Class");

Similar questions