Sample Codes for creating programs
Sunday, February 24, 2013
Sample For Loop 3
public class act5 {
public static void main(String[] args) {
StringBuffer a = new StringBuffer("AB");
for(int i=2; i<=7; i++)
{
System.out.print(a);
for(int j=i; j<=i+2; j++)
System.out.print(a);
a.reverse();
System.out.println();
}
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment