Java Pattern Programs
Write a program in Java to display the following pattern:
3
44
555
6666
77777
Java
Java Nested for Loops
ICSE
38 Likes
Answer
public class KboatPattern
{
public static void main(String args[]) {
for (int i = 3; i <= 7; i++) {
for (int j = 3; j <= i; j++)
System.out.print(i);
System.out.println();
}
}
}
Output
![BlueJ output of Write a program in Java to display the following pattern: 3 44 555 6666 77777 BlueJ output of Write a program in Java to display the following pattern: 3 44 555 6666 77777](https://cdn1.knowledgeboat.com/img/java-programs/solutions-p1-1.jpg)
Answered By
20 Likes