Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 26-04-2007, 05:46 PM   #1 (permalink)
In The Zone
 
Join Date: Mar 2006
Location: Dehradun
Posts: 285
Default JAVA Pattern ???




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

Thank You

Last edited by vineetrocks2005; 26-04-2007 at 05:52 PM.
vineetrocks2005 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 27-04-2007, 10:18 AM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2007
Posts: 37
Smile Re: JAVA Pattern ???

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();
}
}
}
me_ankitroy is offline  
Old 27-04-2007, 10:37 AM   #3 (permalink)
Mad and Furious
 
redhat's Avatar
 
Join Date: May 2006
Location: Visual Basic 6.0
Posts: 453
Default Re: JAVA Pattern ???

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
redhat is offline  
Old 27-04-2007, 03:45 PM   #4 (permalink)
In The Zone
 
Join Date: Mar 2006
Location: Dehradun
Posts: 285
Default Re: JAVA Pattern ???

thanks for help
vineetrocks2005 is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java programming..how can I distribute java program....? Manojap Programming 5 16-05-2009 02:46 PM
Time taken to download Virus pattern file using live update agnels Software Q&A 1 11-02-2006 07:47 AM
Grid pattern (photoshop tutorial) goobimama Tutorials 1 24-05-2005 11:43 AM

 
Latest Threads
- by topgear
- by abhidev
- by clmlbx
- by Sarath

Advertisement




All times are GMT +5.5. The time now is 05:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2