- Home
- Chapter 1 - Object Oriented Programming Concepts
- Object Oriented Programming Concepts
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 2 - Introduction to Java
- Introduction to Java
- Multiple Choice Questions
- Assignment Questions
- Chapter 3 - Values and Data Types
- Values and Data Types
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 4 - Operators in Java
- Operators in Java
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 5 - User-Defined Methods
- User-Defined Methods
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions
- Chapter 6 - Input in Java
- Input in Java
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 7 - Mathematical Library Methods
- Mathematical Library Methods
- Multiple Choice Questions
- Assignment Questions
- Chapter 8 - Conditional Constructs in Java
- Conditional Constructs in Java
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 9 - Iterative Constructs in Java
- Iterative Constructs in Java
- Multiple Choice Questions
- State whether the given statements are True or False
- Assignment Questions and Programs
- Chapter 10 - Nested for loops
- Nested for loops
- Assignment Questions and Programs
- Chapter 11 - Constructors
- Constructors
- Multiple Choice Questions
- Assignment Questions and Programs
- Chapter 12 - Library Classes
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 13 - Encapsulation and Inheritance
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 14 - Arrays
- Library Classes
- Multiple Choice Questions
- Assignment Questions
- Chapter 15 - String Handling
- Library Classes
- Multiple Choice Questions
- Assignment Questions
Nested for Loops
Chapter 10
Nested for Loops
Class 10 - Logix Kips ICSE Computer Applications with BlueJ
![]() Share with a Friend |
Assignment Questions and Programs
1. Write a program to generate the following output.
@
@ #
@ # @
@ # @ #
@ # @ # @
2 (i). Write a program in Java to display the following patterns.
1
2 3
4 5 6
7 8 9 10
11 12 13 14 152 (ii). Write a program in Java to display the following patterns.
1 * * * *
* 2 * * *
* * 3 * *
* * * 4 *
* * * * 5
2 (iii). Write a program in Java to display the following patterns.
#
* *
# # #
* * * *
# # # # #
2 (iv). Write a program in Java to display the following patterns.
1 * * * *
2 2 * * *
3 3 3 * *
4 4 4 4 *
5 5 5 5 5
2 (v). Write a program in Java to display the following patterns.
$ $ $ $ 5
$ $ $ 4
$ $ 3
$ 2
1
2 (vi). Write a program in Java to display the following patterns.
A B C D E
A B C D
A B C
A B
A
2 (vii). Write a program in Java to display the following patterns.
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
2 (viii). Write a program in Java to display the following patterns.
I
I C
I C S
I CI S E
2 (ix). Write a program in Java to display the following patterns.
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
2 (x). Write a program in Java to display the following patterns.
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
4 5
3 4 5
2 3 4 5
1 2 3 4 5
3 (i). Distinguish between the following:
break statement and labelled break statement
3 (ii). Distinguish between the following:
continue statement and labelled continue statement
4. Write a program to print the series given below.
8 88 888 8888 88888 888888
5 (i). What will be the value of sum after each of the following nested loops is executed?
int sum = 0;
for (int i = 0; i <= 10; i++)
for (int j = 0; j <= 10; j++)
sum += i;
5 (ii). What will be the value of sum after each of the following nested loops is executed?
int sum = 0;
for (int i = 1; i <= 3; i++)
for (int j = 1; j <= 3; j++)
sum = sum + (i + j);
6. Write a program to generate a triangle or an inverted triangle till n terms based upon the user's choice of triangle to be displayed.
Example 1
Input:
Type 1 for a triangle and type 2 for an inverted triangle
1
Enter the number of terms
5
Output:1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Example 2
Input:
Type 1 for a triangle and type 2 for an inverted triangle
2
Enter the number of terms
6
Output:6 6 6 6 6 6
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
