Write a java program to print right pascal's triangle of stars
Answers
Answered by
0
Answer:
Algorithm to print right triangle star pattern
Take the number of rows of right triangle as input from user and store it in an integer variable N
Number of star characters in Kth row is always K. 1st row contains 1 star, 2nd row contains 2 stars. In general, Kth row contains K stars.
We will use two for loops to print right triangle star pattern.
Each iteration of outer loop will print one row of the pattern. For a right triangle star pattern of N rows, outer for loop will iterate N time.
Each iteration of inner loop will print one star (*). For Kth row of right triangle pattern, inner loop will iterate K times.
Similar questions
Math,
1 month ago
Physics,
1 month ago
Computer Science,
3 months ago
Science,
9 months ago
Math,
9 months ago