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
Original Khojo Papers practice question — not from a past board paper.
for (int i = n; i >= 1; i--) { for (int j = 1; j <= i; j++) System.out.print("*"); System.out.println(); }
No citable source has been recorded for this record. Treat it as practice material, not as fact.
Counting the outer loop downwards is what inverts the triangle.
From the same topic and chapter, at a similar level.
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
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