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.
12 times
No citable source has been recorded for this record. Treat it as practice material, not as fact.
The inner loop runs 3 times for each of the 4 iterations of the outer loop.
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
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
Write a Java program segment to print the multiplication tables from 1 to 5, each up to 10.
Nested Loops
What is the output of: String s = "Examination"; System.out.println(s.length() + " " + s.substring(0, 4) + " " + s.toUpperCase().charAt(2));
String Handling
Explain the ternary operator in Java and rewrite "if (a > b) max = a; else max = b;" using it.
Operators and Expressions in Java
Reduce the Boolean expression X·Y + X·Y′ using the laws of Boolean algebra.
Boolean Algebra