Status
Not open for further replies.

vineetrocks2005

In the zone
*img83.imageshack.us/img83/7895/untitled1qi4.jpg

I want to generate the above pattern or series in JAVA...please help??
very urgently required

Thank You
 
Last edited:

me_ankitroy

Broken In
You can use this following code in JAVA Compiler It will give you the same patern


//program to print Pattern
class ankit
{
public static void main(String args[])
{
int i,no,j;
no=5;
for(i=0;i<no;i++)
{
for(j=no;j>i;j--)
{
System.out.print(" ");
}
for(j=0;j<=i;j++)
{
System.out.print(" * ");
}
System.out.println();
}
}
}
 

redhat

Mad and Furious
public class design
{
public void designs(int no)
{int sp=no-1;
for(int i=1;i<=no;i++)
{for(int k=1;k<=sp;k++)
{System.out.print(" ");
}
sp--;
for(int j=1;j<=i;j++)
{System.out.print("* ");
}
System.out.println();
}
sp=1;
}
}


---> Tis will give a more compact form of the design. To make it as large, as shown, add an extra space before the asterix(*) is printed
 
Status
Not open for further replies.
Top Bottom