60 549
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #29023 in Java | JSP | JSF for Zus ming

Question #29023
I have been Asked to a java program that display the following output using the conditional control statement :.

.The Output :.

@
@ @
@ @ @
@ @ @ @
@ @ @ @ @
@ @ @ @ @ @
@ @ @ @ @
@ @ @ @
@ @ @
@ @
@

Thats All .
Expert's answer

//class Pattern
public class Pattern {

//main function
public static void main(String[] args) {
String str="";//declare variable str
for(int i=0;i<6;i++){
//show result
str+="@";
System.out.println(str);
}
String newstr="";//declare new variable newstr for bottom
for(int i=5;i>0;i--){
newstr="";
for(int j=0;j<i;j++){
newstr+=str.charAt(j);
}
System.out.println(newstr);//show bottom

}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions