write a program in Java to print the following pattern
Attachments:
Answers
Answered by
3
let me tell u the logic as i dont know java programming
look at the pattern it shows 2 inverted triangle
first building the logic for inverted triangle
from the first row the column decrements
so use the loop
for(i=1;i<=5;i++)
and the inner loop
for(j=1;j<=i;j--)
and in the same way for the other triangle
then add a for loop for both the triangles
look at the pattern it shows 2 inverted triangle
first building the logic for inverted triangle
from the first row the column decrements
so use the loop
for(i=1;i<=5;i++)
and the inner loop
for(j=1;j<=i;j--)
and in the same way for the other triangle
then add a for loop for both the triangles
Nik7117:
thanks
Similar questions
English,
7 months ago
Math,
7 months ago
Science,
7 months ago
Math,
1 year ago
Social Sciences,
1 year ago