answer please
1
3 3
5 5 5
7 7 7 7
9 9 9 9 9
write a logical program using nested loop
any newsense will be reported.
Answers
Answered by
3
Write a program to display the following pattern.
1
33
555
7777
99999
import java.util.*;
class Pattern
{
public static void main()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the number of rows for the pattern: ");
int rows=sc.nextInt();
for(int i=1;i<=rows;i+=+)
{
int a=1;
for(int j=1;j<=i;j++)
System.out.print(a+" ");
a+=2;
System.out.println();
}
} // end of main.
} // end of class.
Similar questions
English,
4 months ago
English,
4 months ago
Social Sciences,
4 months ago
English,
8 months ago
Political Science,
8 months ago
Chemistry,
1 year ago
Hindi,
1 year ago