0% found this document useful (0 votes)
17 views7 pages

Output Questions

The document contains a series of Java programming questions designed for ICSE students, focusing on output-based coding exercises. Each question presents a Java class with a main method that includes various programming constructs such as arithmetic operations, conditional statements, loops, and triangle validation logic. Some questions are left blank for students to fill in with their own Java code.

Uploaded by

dugarparas5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Output Questions

The document contains a series of Java programming questions designed for ICSE students, focusing on output-based coding exercises. Each question presents a Java class with a main method that includes various programming constructs such as arithmetic operations, conditional statements, loops, and triangle validation logic. Some questions are left blank for students to fill in with their own Java code.

Uploaded by

dugarparas5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ICSE Java Output-Based Questions

Q.1
class Test {
public static void main(String args[]) {
int a = 5, b = 3, c;
c = a++ + --b * a / b++;
System.out.println(c);
}
}

Q.2
class Test {
public static void main(String args[]) {
int x = 10, y = 20;
if (x++ > 10 || --y < 20) {
System.out.println(x + " " + y);
} else {
System.out.println(y + " " + x);
}
}
}

Q.3
class Test {
public static void main(String args[]) {
int i = 1, sum = 0;
while (i < 5) {
sum += i;
i++;
}
System.out.println(sum);
}
}
Q.4
class Test {
public static void main(String args[]) {
int num = 5, count = 1;
do {
System.out.print(num * count + " ");
count++;
} while (count <= 3);
}
}

Q.5
class Test {
public static void main(String args[]) {
int a = 3, b = 4, c = 5;
if (a + b > c) {
if (b + c > a) {
if (c + a > b) {
System.out.println("Valid Triangle");
}
}
} else {
System.out.println("Invalid Triangle");
}
}
}

Q.6
class Test {
public static void main(String args[]) {
int x = 1;
for (int i = 1; i <= 3; i++) {
x *= i;
}
System.out.println(x);
}
}

Q.7
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.8
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.9
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.10
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.11
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.12
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.13
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.14
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.15
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.16
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.17
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.18
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.19
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.20
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.21
class Test {
public static void main(String args[]) {
// Java Code Here
}
}
Q.22
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.23
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.24
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.25
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.26
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.27
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.28
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.29
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

Q.30
class Test {
public static void main(String args[]) {
// Java Code Here
}
}

You might also like