A

Admin • 831K Points
Coach

Q. What is printed?
for(int i=1;i<=3;i++){
for(int j=1;j<=i;j++){
System.out.print("*");
}
System.out.println();
}

  • (A) ***
  • (B) * ** ***
  • (C) *** ** *
  • (D) * * *
  • Correct Answer - Option(B)
  • Views: 13
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
This loop prints a right-angled triangle pattern.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.