Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (1 vote)
2K views3 pages

Java Class 8 ICSE Coding Questions

This document contains a series of Java coding questions for Class 8 ICSE students. It includes tasks such as calculating the sum of two integers, checking if a number is even or odd, printing a multiplication table, finding the largest of three numbers, and calculating the factorial of a number. Each question provides input and output examples to guide students in their coding practice.

Uploaded by

akshitheliwal
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 (1 vote)
2K views3 pages

Java Class 8 ICSE Coding Questions

This document contains a series of Java coding questions for Class 8 ICSE students. It includes tasks such as calculating the sum of two integers, checking if a number is even or odd, printing a multiplication table, finding the largest of three numbers, and calculating the factorial of a number. Each question provides input and output examples to guide students in their coding practice.

Uploaded by

akshitheliwal
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/ 3

Class 8 ICSE - Java Coding Questions

Q1. Write a Java program to print the sum of two integers.

Input:

- Take two integers as input from the user.

Output:

- Print the sum of these integers.

Sample Input:

Enter the first number: 5

Enter the second number: 10

Sample Output:

The sum of 5 and 10 is 15.

Q2. Write a Java program to check if a number is even or odd.

Input:

- Take an integer input from the user.

Output:

- Print whether the number is even or odd.

Sample Input:

Enter a number: 7
Sample Output:

7 is an odd number.

Q3. Write a Java program to print the multiplication table of a number.

Input:

- Take an integer input from the user.

Output:

- Print the multiplication table of that number up to 10.

Sample Input:

Enter a number: 4

Sample Output:

4x1=4

4x2=8

...

4 x 10 = 40

Q4. Write a Java program to find the largest of three numbers.

Input:

- Take three integer inputs from the user.

Output:

- Print the largest number among the three.


Sample Input:

Enter first number: 3

Enter second number: 8

Enter third number: 5

Sample Output:

The largest number is 8.

Q5. Write a Java program to calculate the factorial of a number using a loop.

Input:

- Take an integer input from the user.

Output:

- Print the factorial of the number.

Sample Input:

Enter a number: 5

Sample Output:

The factorial of 5 is 120.

You might also like