Advertisements
Advertisements
Question
Give an example of a compound statement.
Answer in Brief
Solution
if (a > b)
{ sum = a + b;
pdt = a * b;
}
In the example above, the statements placed in curly brackets are carried out if the condition is true.
shaalaa.com
Is there an error in this question or solution?
Chapter 1.08: Conditional Statements in Java - EXERCISES [Page 100]