0% found this document useful (0 votes)
2 views1 page

Javaloop Star Pattern Generator

The Java program defines a class 'Javaloop' with a main method that prints a right-angled triangle of asterisks. It uses nested loops to control the number of asterisks printed on each line, with the outer loop iterating from 0 to n (5 in this case) and the inner loop printing asterisks based on the current iteration of the outer loop. The output will display a triangle shape with increasing numbers of asterisks per line.

Uploaded by

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

Javaloop Star Pattern Generator

The Java program defines a class 'Javaloop' with a main method that prints a right-angled triangle of asterisks. It uses nested loops to control the number of asterisks printed on each line, with the outer loop iterating from 0 to n (5 in this case) and the inner loop printing asterisks based on the current iteration of the outer loop. The output will display a triangle shape with increasing numbers of asterisks per line.

Uploaded by

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

package javaloop;

public class Javaloop {

public static void main(String[] args) {


// TODO Auto-generated method stub
int n=5;
for(int i=0; i<n; i++) {
for(int j=0; j<=i ;j++) {

[Link]("*");
}
[Link]();
}

You might also like