Write a program (Java) to print the following pattern -
3 6 9 12 15
3 6 9 12
3 6 9
3 6
3
Answers
Answer:
follow me
make as brainliest ans
likes my All ans
ok
Explanation:
import java.util.Scanner;
public class MainClass
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
//Taking rows value from the user
System.out.println("How many rows you want in this pattern?");
int rows = sc.nextInt();
System.out.println("Here is your pattern....!!!");
for (int i = 3; i <= rows; i++)
{
for (int j = 3; j <= i; j++)
{
System.out.print(j+" ");
}
System.out.println();
}
//Close the resources
sc.close();
}
Explanation:
hope it helps you!