Generating Random Numbers in a Range with C/VB

AI Thread Summary
To generate a random range of numbers from a specified longer range in C, one can allocate a new array for the random values. The process involves defining the number of values (n) to be generated, creating an array to hold these random numbers, and then populating this array with random selections from the original range. The output will be the newly created array containing the random numbers. The user also mentioned finding a solution independently, indicating that the problem was resolved without needing further assistance.
gulu9
Messages
2
Reaction score
0
i want to get a random range of numbers of a longger range of number, ex, longer range i=6,9,96,8,6,5,6,5,6,5,4,5,6,6,11,6,1,11,2,113,16
randome range is numbers random in taht range
i m using c, u can also give me source code in vb if u can do it in vb
thnks
 
Last edited:
Computer science news on Phys.org
never mind i figure it out,
input n //n new values to allocate new
another array with n range be made by new
and finally output them
 
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...

Similar threads

Back
Top