Computer Science, asked by Nik7117, 1 year ago

write a program in Java to display the following program

Attachments:

Answers

Answered by aditi4121
5
Initiate integers then,
for(i=1; i =<5 ;++i){
System. out.println();
for(j=1;j<=i ;++j)
System. out.print("a");
}
for (i=4;i>=1;--i){
System. out.println();
for(j=4;j>=i;--j)
System. out. print("a");
}

Nik7117: I am sorry to say that your program is wrong
Nik7117: no lines show error
aditi4121: so what is the problem in executing it
aditi4121: what type of error is comimg
Nik7117: the program does not show any syntax error but the output which came was wrong
aditi4121: what is the output
Nik7117: the output is a a a a a a a a a a a a a a a a a
aditi4121: hmm i will figure it out
Nik7117: I got a new answer of the question
aditi4121: ok
Answered by NikhilRaj1171
3
the attachment is your answer
Attachments:
Similar questions