Write a Java program segment to print an inverted right-angled triangle of stars with n rows, the first row having n stars.
Nested Loops
Original Khojo Papers practice question — not from a past board paper.
for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 10; j++) System.out.print(i * j + " "); System.out.println(); }
No citable source has been recorded for this record. Treat it as practice material, not as fact.
The outer loop chooses the table and the inner loop runs through its terms.
From the same topic and chapter, at a similar level.
Write a Java program segment to print an inverted right-angled triangle of stars with n rows, the first row having n stars.
Nested Loops
How many times does the inner statement execute in: for (int i = 1; i <= 4; i++) for (int j = 1; j <= 3; j++) count++;
Nested Loops
Write a Java program segment to print the following pattern for n = 4: a right-angled triangle of stars with 1 star in the first row and 4 in the last.
Nested Loops
State and prove De Morgan's two theorems using a truth table.
Boolean Algebra
Distinguish between the canonical SOP and POS forms of a Boolean expression.
Boolean Algebra
Explain the ternary operator in Java and rewrite "if (a > b) max = a; else max = b;" using it.
Operators and Expressions in Java