473,320 Members | 1,884 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,320 software developers and data experts.

numbers

how can I display a set of numbers like this:
1 2 3 4 5 6 ...
instead of this
1
2
3
4
5
....

Jul 21 '05 #1
9 1370
WHat are you trying to display it in?
"freddy" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
how can I display a set of numbers like this:
1 2 3 4 5 6 ...
instead of this
1
2
3
4
5
...

Jul 21 '05 #2
numbers from 1 to 50 ---> that way and
1
to
50
that way
-----Original Message-----
WHat are you trying to display it in?
"freddy" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
how can I display a set of numbers like this:
1 2 3 4 5 6 ...
instead of this
1
2
3
4
5
...

.

Jul 21 '05 #3
Where do you want these to appear though, in what control?
"freddy" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
numbers from 1 to 50 ---> that way and
1
to
50
that way
-----Original Message-----
WHat are you trying to display it in?
"freddy" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
how can I display a set of numbers like this:
1 2 3 4 5 6 ...
instead of this
1
2
3
4
5
...

.

Jul 21 '05 #4
in a console app.using a for loop
-----Original Message-----
Where do you want these to appear though, in what control?
"freddy" <an*******@discussions.microsoft.com> wrote in messagenews:05****************************@phx.gbl...
numbers from 1 to 50 ---> that way and
1
to
50
that way
>-----Original Message-----
>WHat are you trying to display it in?
>"freddy" <an*******@discussions.microsoft.com> wrote in

message
>news:04****************************@phx.gbl...
>> how can I display a set of numbers like this:
>> 1 2 3 4 5 6 ...
>> instead of this
>> 1
>> 2
>> 3
>> 4
>> 5
>> ...
>>
>
>
>.
>

.

Jul 21 '05 #5
SFB
For to build a single string or line

"freddy" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
in a console app.using a for loop
-----Original Message-----
Where do you want these to appear though, in what control?
"freddy" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
numbers from 1 to 50 ---> that way and
1
to
50
that way

>-----Original Message-----
>WHat are you trying to display it in?
>"freddy" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> how can I display a set of numbers like this:
>> 1 2 3 4 5 6 ...
>> instead of this
>> 1
>> 2
>> 3
>> 4
>> 5
>> ...
>>
>
>
>.
>

.

Jul 21 '05 #6
Freddy,
I hope this is not a homework question! ;-)
1
to
50
that way For i As Integer = 1 to 50
Console.WriteLine(i)
Next i
numbers from 1 to 50 ---> that way
For i As Integer = 1 to 50
Console.Write(i)
Console.Write(" "c)
Next i
Console.WriteLine()

Notice in the first one I used WriteLine to cause each item to appear on a
line by itself, where as in the second one I only used Write inside the
loop, and a WriteLine outside to loop to get a single line of output. (of
course the second one will wrap by itself once the line gets past 25
characters ;-))

Hope this helps
Jay
"freddy" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl... in a console app.using a for loop
-----Original Message-----
Where do you want these to appear though, in what control?
"freddy" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
numbers from 1 to 50 ---> that way and
1
to
50
that way

>-----Original Message-----
>WHat are you trying to display it in?
>"freddy" <an*******@discussions.microsoft.com> wrote in
message
>news:04****************************@phx.gbl...
>> how can I display a set of numbers like this:
>> 1 2 3 4 5 6 ...
>> instead of this
>> 1
>> 2
>> 3
>> 4
>> 5
>> ...
>>
>
>
>.
>

.

Jul 21 '05 #7
I just want to understand the code. I think I can use
jagged array,the problem is evertime I do a search it
comes up with c# not vb.net.
-----Original Message-----
Freddy,
I hope this is not a homework question! ;-)
>> 1
>> to
>> 50
>> that way For i As Integer = 1 to 50
Console.WriteLine(i)
Next i
>> numbers from 1 to 50 ---> that way
For i As Integer = 1 to 50
Console.Write(i)
Console.Write(" "c)
Next i
Console.WriteLine()

Notice in the first one I used WriteLine to cause each

item to appear on aline by itself, where as in the second one I only used Write inside theloop, and a WriteLine outside to loop to get a single line of output. (ofcourse the second one will wrap by itself once the line gets past 25characters ;-))

Hope this helps
Jay
"freddy" <an*******@discussions.microsoft.com> wrote in messagenews:06****************************@phx.gbl...
in a console app.using a for loop
>-----Original Message-----
>Where do you want these to appear though, in what control? >"freddy" <an*******@discussions.microsoft.com> wrote in

message
>news:05****************************@phx.gbl...
>> numbers from 1 to 50 ---> that way and
>> 1
>> to
>> 50
>> that way
>>
>> >-----Original Message-----
>> >WHat are you trying to display it in?
>> >"freddy" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:04****************************@phx.gbl...
>> >> how can I display a set of numbers like this:
>> >> 1 2 3 4 5 6 ...
>> >> instead of this
>> >> 1
>> >> 2
>> >> 3
>> >> 4
>> >> 5
>> >> ...
>> >>
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Jul 21 '05 #8
Freddy,
I just want to understand the code. Understand what code, you have not shown any code, you asked how to
"display" something...
I think I can use
jagged array,the problem is evertime I do a search it
comes up with c# not vb.net. Now up until this message you made no mention of an array. My code does not
involve arrays!

What is it you want to do, do you want to print numbers on the console as I
have shown? Or do you have an array question?

Do you want an array with a single column of 50 values?

Dim x(49) As Integer ' remember its high bound, not length

Do you want an array with a single row of 50 values?

Dim x(0,49) As Integer

Do you want a jagged array? (note: VB.NET also refers to jagged arrays as
"Arrays of arrays")

Dim x()() As Integer

For info on arrays in VB.NET see:
http://msdn.microsoft.com/library/de...bconArrays.asp
http://msdn.microsoft.com/library/de...fVBSpec6_8.asp

Or are you asking about something entirely different? ;-)

Hope this helps
Jay
"freddy" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl... I just want to understand the code. I think I can use
jagged array,the problem is evertime I do a search it
comes up with c# not vb.net.
-----Original Message-----
Freddy,
I hope this is not a homework question! ;-)
>> 1
>> to
>> 50
>> that way

For i As Integer = 1 to 50
Console.WriteLine(i)
Next i
>> numbers from 1 to 50 ---> that way

For i As Integer = 1 to 50
Console.Write(i)
Console.Write(" "c)
Next i
Console.WriteLine()

Notice in the first one I used WriteLine to cause each

item to appear on a
line by itself, where as in the second one I only used

Write inside the
loop, and a WriteLine outside to loop to get a single

line of output. (of
course the second one will wrap by itself once the line

gets past 25
characters ;-))

Hope this helps
Jay
"freddy" <an*******@discussions.microsoft.com> wrote in

message
news:06****************************@phx.gbl...
in a console app.using a for loop
>-----Original Message-----
>Where do you want these to appear though, in what control? >"freddy" <an*******@discussions.microsoft.com> wrote in
message
>news:05****************************@phx.gbl...
>> numbers from 1 to 50 ---> that way and
>> 1
>> to
>> 50
>> that way
>>
>> >-----Original Message-----
>> >WHat are you trying to display it in?
>> >"freddy" <an*******@discussions.microsoft.com> wrote in >> message
>> >news:04****************************@phx.gbl...
>> >> how can I display a set of numbers like this:
>> >> 1 2 3 4 5 6 ...
>> >> instead of this
>> >> 1
>> >> 2
>> >> 3
>> >> 4
>> >> 5
>> >> ...
>> >>
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Jul 21 '05 #9
Both websites are very helpful
-----Original Message-----
in a console app.using a for loop
-----Original Message-----
Where do you want these to appear though, in what control?"freddy" <an*******@discussions.microsoft.com> wrote in

message
news:05****************************@phx.gbl...
numbers from 1 to 50 ---> that way and
1
to
50
that way

>-----Original Message-----
>WHat are you trying to display it in?
>"freddy" <an*******@discussions.microsoft.com> wrote in message
>news:04****************************@phx.gbl...
>> how can I display a set of numbers like this:
>> 1 2 3 4 5 6 ...
>> instead of this
>> 1
>> 2
>> 3
>> 4
>> 5
>> ...
>>
>
>
>.
>

.

.

Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: August1 | last post by:
A handful of articles have been posted requesting information on how to use these functions in addition to the time() function as the seed to generate unique groups (sets) of numbers - each group...
16
by: StenKoll | last post by:
Help needed in order to create a register of stocks in a company. In accordance with local laws I need to give each individual share a number. I have accomplished this by establishing three tables...
12
by: Jim Michaels | last post by:
I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's...
7
by: Gerard Flanagan | last post by:
All would anyone happen to have code to generate Cutter Numbers: eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm or is anyone looking for something to do?-) (I'm under...
10
by: LuTHieR | last post by:
Hi, I'm reading a string of numbers from a file (using Borland C++ Builder 6), and I'm doing it like this: first I use FileRead to store all the data in the file to a char* variable (appropriately...
7
by: newstips6706 | last post by:
1, 2, 3, 5, 7... PRIME Numbers ________________________________ Definitions What is a PRIME Number ?
17
by: Ron | last post by:
I want to write a program that will accept a number in a textbox for example 23578 and then in a label will display the sum of the odd and even number like this... the textbox containsthe number...
13
by: Peter Oliphant | last post by:
I would like to be able to create a random number generator that produces evenly distributed random numbers up to given number. For example, I would like to pick a random number less than 100000,...
24
by: pereges | last post by:
I need to generate two uniform random numbers between 0 and 1 in C ? How to do it ? I looked into rand function where you need to #define RAND_MAX as 1 but will this rand function give me ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.