473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Suggest me

Hi Friends,
How to generate dynamically the output
*
* *
* * *
* *
*
without giving the constant number as (3 max).
Suppose if we give it as 4 it should give o/p as
*
* *
* * *
* * * *
* * *
* *
*
Jun 8 '07 #1
5 1066
r035198x
13,262 8TB
Hi Friends,
How to generate dynamically the output
*
* *
* * *
* *
*
without giving the constant number as (3 max).
Suppose if we give it as 4 it should give o/p as
*
* *
* * *
* * * *
* * *
* *
*
Now that is very simple to produce. Write it and see. Just put together your algorithm. You can use + to add two Strings together and the substring method can be used to chop off character(s) from a string ....
Jun 8 '07 #2
JosAH
11,448 Expert 8TB
Hi Friends,
How to generate dynamically the output
Expand|Select|Wrap|Line Numbers
  1. -------
  2.  
  3.   *
  4.  * *
  5. * * *
  6.  * *
  7.   * 
  8.  
without giving the constant number as (3 max).
I put a few code tags around your little picture and it turned out to be an
entirely different picture. Just for the record ...

kind regards,

Jos
Jun 8 '07 #3
prometheuzz
197 Expert 100+
Hi Friends,
How to generate dynamically the output

...

Here's a hint:
Expand|Select|Wrap|Line Numbers
  1. n = 3, lines = 5
  2.  
  3.   *            starting spaces = 2, stars = 1
  4.  * *     starting spaces = 1, stars = 2
  5. * * *     starting spaces = 0, stars = 3
  6.  * *     starting spaces = 1, stars = 2
  7.   *            starting spaces = 2, stars = 1
  8.  
  9.  
  10. n = 4, lines = 7
  11.  
  12.    *      starting spaces = 3, stars = 1
  13.   * *      starting spaces = 2, stars = 2
  14.  * * *        starting spaces = 1, stars = 3
  15. * * * *         starting spaces = 0, stars = 4
  16.  * * *        starting spaces = 1, stars = 3
  17.   * *      starting spaces = 2, stars = 2
  18.    *      starting spaces = 3, stars = 1
Jun 8 '07 #4
r035198x
13,262 8TB
I put a few code tags around your little picture and it turned out to be an
entirely different picture. Just for the record ...

kind regards,

Jos
Wow, now what made you think of that? The OP also didn't bother checking their own post too ....
Jun 9 '07 #5
JosAH
11,448 Expert 8TB
Wow, now what made you think of that? The OP also didn't bother checking their own post too ....
My thoughts were: "sloppy". When a poster doesn't care to go through the
"trouble" to make his/her question clear and not mislead his/her reading audience,
IMHO the question is not worth to be answered. I'm not talking about the level
of command of the English language. This may seem arrogant, but imagine
people give hints about how to create such a "triangle"; it would end up being
a complete mess and misunderstanding between the OP and his/her reading
audience; not something we, nor anybody else, want.

kind regards,

Jos
Jun 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: santanu | last post by:
Hi all, I know a little python (not the OOP part) learnt by studying the online tutorial. Now I would like to learn it more thoroughly. I have access to 'Programming Python' which I liked...
2
by: srinivas | last post by:
HI, I am a dotnet developer.Ho we can do the functionality exists in google suggest site (http://www.google.com/webhp?complete=1&hl=en).In this site in search text box if we enter some text it...
4
by: guoqi zheng | last post by:
On this link http://www.google.com/webhp?complete=1 when you are typing a word, google will get the suggest outcome immediately, any idea how can they do this? There is a onchange event on...
8
by: rAinDeEr | last post by:
Hi, I have a table with the following 2 Fields - one is the description name and the second is its description to be stored in a table. description name description...
2
by: awebguynow | last post by:
It seems like I've been reading the code to Google Suggest (GS) for about a week, and I'm going to have to wrap it up shortly. I'm OK with many of the subjects, and I would say I have...
3
by: ashutosh | last post by:
I am working for a company and working for printer drivers. Most of the work is in ddk, VC++ and C++, gdi calls. I have studied C++ and ddk and VC++ is new for me. Can anybody suggest me some good...
2
by: Thierry Lam | last post by:
I implemented the autocomplete/suggest for a text input, however the suggest div table does not overlap the other widgets underneath my text input. All it does is create space between my text input...
2
by: only2gayathri | last post by:
Hi all, I have a page(vb.net) which directs to a excel sheet.This excel sheet retains all the values(mainly numbers) from the page and displays it.The problem is that sometimes the number's...
6
by: natkw1 | last post by:
Hi all, I'm new to C and kind of confused on this. I've had a look around this group for suggestions but still not sure why the warning is occurring. What I've done is this <code snip> void...
4
by: muddasirmunir | last post by:
Well i want to make a simple website , for which i need some suggestion from you people. I have good idea about front page to make website but the tool not looking great so please suggest me some...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.