A simple java program to print the following output .

Posted: February 8, 2012 in Java Programs

$
$$
$$$
$$$$
$$$$$
$$$$$$
$$$$$$$
$$$$$$$$
$$$$$$$$$
$$$$$$$$$$
$$$$$$$$$$$
$$$$$$$$$$$$
$$$$$$$$$$$$$
$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$
@@@@@@@@@@@@@@
@@@@@@@@@@@@@
@@@@@@@@@@@@
@@@@@@@@@@@
@@@@@@@@@@
@@@@@@@@@
@@@@@@@@
@@@@@@@
@@@@@@
@@@@@
@@@@
@@@
@@
@


import java.util.*;
class Demo1
{
public static void main(String g[])
{

for (int i=1; i<=15; i++)
{
System.out.println();
for (int j=1; j<=i; j++)
{
System.out.print(“$”);
}
}
System.out.println();

for(int m=1;m<15;m++)
{
for(int n=m;n<15;n++)
{
System.out.print(“@”);
}
System.out.println();
}

}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s