Generating Random Numbers in a Range with C/VB

Click For Summary
SUMMARY

The discussion focuses on generating random numbers within a specified range using C and Visual Basic (VB). The user initially sought assistance for creating a random number generator that selects values from a longer array of integers. After some exploration, the user resolved the issue independently by allocating a new array for the random values and outputting them accordingly. The conversation highlights the importance of understanding array manipulation and random number generation in programming.

PREREQUISITES
  • Understanding of C programming language syntax and structures
  • Familiarity with Visual Basic (VB) programming concepts
  • Knowledge of array allocation and manipulation techniques
  • Basic principles of random number generation algorithms
NEXT STEPS
  • Research C standard library functions for random number generation
  • Explore Visual Basic's Randomize and Rnd functions for generating random numbers
  • Learn about dynamic memory allocation in C using malloc and free
  • Investigate algorithms for generating random numbers within a specified range
USEFUL FOR

Programmers and developers working with C or Visual Basic, particularly those interested in random number generation and array manipulation techniques.

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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K