What are conditional control structures of 0?
Answers
Answered by
1
A condition in which answer is in true or false that is in boolean is called conditional control structure
Answered by
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:-
- The block statement following the if condition is executed only if the condition is true.
- If the statement is false the statement follows the else .
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
Math,
7 months ago
Science,
7 months ago
Math,
7 months ago
Math,
1 year ago
Social Sciences,
1 year ago