473,402 Members | 2,046 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,402 software developers and data experts.

How to generate 52 different random number??

I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~

Thanks~

Apr 8 '06 #1
6 1832
"Brian" <ke*********@yahoo.com.hk> schrieb im Newsbeitrag news:11**********************@u72g2000cwu.googlegr oups.com...
I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~


What kind of numbers? Natural numbers, rational numbers odr real numbers?

Heinz
Apr 8 '06 #2
just real numbers

Apr 8 '06 #3
"Brian" writes:
I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~


Are you sure you are supposed to start with 2?

Look up "shuffle" on Google.
Apr 8 '06 #4
Brian posted:
I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~

Thanks~


Why not search google for C++ Lottery?

www.planetsourcecode.com might be of help too.
-Tomás
Apr 8 '06 #5
osmium wrote:
"Brian" writes:
I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~


Are you sure you are supposed to start with 2?


Are you sure the assignment is limited to integral values?
Apr 8 '06 #6

Victor Bazarov wrote:
osmium wrote:
"Brian" writes:
I hv a school assignment that is to generate 52 different random
number, where all the numbers must >1 and <53. Pls help~


Are you sure you are supposed to start with 2?


Are you sure the assignment is limited to integral values?


In fact, Brian has confirmed that real numbers are OK, too. It better
be,
since there are only 51 integers >1 and <53. Now, I'm betting that
Brain hasn't yet figured out what "different real numbers" really
means.

HTH,
Michiel Salters

Apr 10 '06 #7

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

Similar topics

2
by: Laphan | last post by:
Hi All This is a strange request, but I just cannot fathom how to do it. In theory the requirement is very basic, but in practise its a noodle!! I have 10 team names like so: Team A Team...
6
by: Acacia | last post by:
How would you generate a random number in C++?
15
by: John Cassidy | last post by:
This has been driving me crazy. I've done basic C in school, but my education is mainly based on object oriented design theory where Java is our tool. For some reason, while helping a friend with a...
2
by: Henry | last post by:
Hi, How can I generate an eight digit random? Can I use the staff name to generate it? May I ask is there any sample c# code to see? Thanks
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...
3
by: td0g03 | last post by:
Like the titles says I'm suppose to generate a random number then divide that by a number inputed by a user. The random number can range from 2-8. I tried to do the code, but I get some weird result...
9
by: Alan Isaac | last post by:
I need access to 2*n random choices for two types subject to a constraint that in the end I have drawn n of each. I first tried:: def random_types(n,typelist=): types = typelist*n...
20
by: jjmillertime | last post by:
I'm new so i apologize if this is in the wrong spot. I'm also new to programming in C and i've been searching for quite a while on how to create a program using C that will generate two random...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.