answersLogoWhite

0


Best Answer

Random numbers cannot be generated programatically. For pseudo-random numbers use function 'rand'.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get a random number from a group of numbers in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is srand in c plus plus?

Srand (seed random ) is used to seed random numbers and is used before calling the rand() or the random number generator. Seeding random numbers ensures that each time the code is executed the number generated is completely random. srand requires one parameter. For most cases it is sufficient to make this parameter time(NULL) [remember to include time.h] as this will seed a new bunch of random number every second


How do you create stream of random number using c language?

Use rand() which returns any random number To be more precise , use random(a) which returns any number from 0 to a-1 For compiling the program again and again , use randomize() so that every time it takes different random numbers. It may be rand <-> random Check it out...


Show that the set of all real numbers is a group with respect to addition?

Closure: The sum of two real numbers is always a real number. Associativity: If a,b ,c are real numbers, then (a+b)+c = a+(b+c) Identity: 0 is the identity element since 0+a=a and a+0=a for any real number a. Inverse: Every real number (a) has an additive inverse (-a) since a + (-a) = 0 Those are the four requirements for a group.


How do you generate true random numbers?

True random numbers need a number frame to give it space. Try perl. type in $randomnumber1=int(rand(200))+1; you can change the 200 to anything you like and it will generate a random number between whatever your number is and one.


How do you write C program to print a Series of Odd Numbers and Even Numbers.?

Generate a random number in half the range you are interested in. If generating odd values, subtract 1 from the upper bound of the range. That is, if the range is 0 to 100, then generate a random number in the range 0 to 50 for even numbers and 0 to 49 for odd numbers. Double the generated number to obtain the even value, or double it and add 1 to obtain the odd value.


What do the numbers represent in CH2?

-CH2- There is one carbon (C) and two hydrogens (H) in this methylene group. It is part of another group and considered the function group.


Write a c program to print different number into a random order at number of compile times?

This program generates so called pseudo random numbers, and it used srand() function to connect the seed for the random number generator to the current. Which makes it less predictable but cannot claimed as a real random number generator.#include #include #include int main(){srand((unsigned) time(NULL));std::cout


Do you make up random numbers when coming up with a question for Pythagoras?

Yes, when coming up and creating your own question you can make up random numbers, just make sure that the base and height (a & b) are no larger than the hypotenuse (c). So make sure the hypotenuse is the largest number out of the 3.


What kind of probabilistic distribution is followed by the random number generation function in C?

gaussian


How are pythagorean triples different to other triads?

for numbers a,b, and c to be a pythagorean triple, they must obey the rule a^2+b^2=c^2. This is not true of 3 numbers picked at random of course.


In a x c 128 a is a one-digit number and c is a two-digit number what numbers could a and c represent?

28X6


Addition of two numbers on plsql program?

--THE SUM OF TWO NUMBERS: declare a number(2); b number(2); c number(2); begin a:=&a; b:=&b; c:=a+b; dbms_output.put_line(a ' + 'b' = 'c); end;