473,657 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i write C code that generate random number without using built in code

plz reply,
thanks in advance.
bye
Nov 14 '05 #1
12 5010
Sweety wrote:
plz reply,
thanks in advance.
bye


HOMEWORK QUESTION
Nov 14 '05 #2
Sweety wrote:
plz reply,
thanks in advance.
bye


HOMEWORK QUESTION
Nov 14 '05 #3
Em Sun, 04 Apr 2004 20:03:48 +0000, Tom St Denis escreveu:
Sweety wrote:
plz reply,
thanks in advance.
bye


HOMEWORK QUESTION


What question? I don't see any question.

--
Quidquid latine dictum sit altum viditur

Nov 14 '05 #4
Em Sun, 04 Apr 2004 20:03:48 +0000, Tom St Denis escreveu:
Sweety wrote:
plz reply,
thanks in advance.
bye


HOMEWORK QUESTION


What question? I don't see any question.

--
Quidquid latine dictum sit altum viditur

Nov 14 '05 #5
Sweety wrote:
plz reply,
No sweat.
thanks in advance.
No problem.
bye


Bye.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #6
Sweety wrote:
plz reply,
No sweat.
thanks in advance.
No problem.
bye


Bye.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #7
http://benpfaff.org/writings/clc
--
"The way I see it, an intelligent person who disagrees with me is
probably the most important person I'll interact with on any given
day."
--Billy Chambless
Nov 14 '05 #8
http://benpfaff.org/writings/clc
--
"The way I see it, an intelligent person who disagrees with me is
probably the most important person I'll interact with on any given
day."
--Billy Chambless
Nov 14 '05 #9
Sweety wrote:
plz reply,
thanks in advance.
bye

You cannot generate truly random numbers (without an external device) in
the mathematical sense of the word. You can only generate pseudorandom
numbers. For the discussion, google the topics "alternativ e rand()", etc.

My favourie, although very slow method for generating a sequence of
pseudorandoms in the interval [0,1] is

next_number := after_comma_par t_of ((Pi+previous_n umber)^5)
--
Best regards,
Alex.

PS. To email me, remove "loeschedie s" from the email address given.
Nov 14 '05 #10

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

Similar topics

3
6240
by: vishal | last post by:
i want to generate a random number of a fixed length so how can i do this ?? i know some function which returns a single random character at a time but is there any built-in function which takes length of string and return a random string of that length?????? can i implement mechanism so that the random number generated is form a list of characters i specify. e.g. suppose if i want to create a random
2
8284
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 B
10
2494
by: Virus | last post by:
Ok well what I am trying to do is have 1.) the background color to change randomly with 5 different colors.(change on page load) 2,) 10 different quotes randomly fadeing in and out in random spots on the webpage. with a delay timer on them, so they keep changing as the page is open. Not random each time the page is loaded. If anyone can help it would be greatly appreaciated, I have tried many of
16
4208
by: Jason | last post by:
Hi, I need a way to use random numbers in c++. In my c++ project, when using the mingw compiler I used a mersenne twister that is publicly available and this did its job well. Now I have shelled out on VC++ 6.0 compiling that same code is proving difficult. I am not too worried how I generate random numbers in c++, as long as it is sufficiently random. Can anybody help me out in getting what I want from VC++?
11
3530
by: Lues | last post by:
Hi, I'm trying to protect some data in tables with encription (you know why, don't you ;)) I must confess that I'm not very expirienced in writing code, especially encription code. Can any one, please , send VB code for access which I can c/p into one function. It don't have to be RSA, it can be anything which is easy to
6
600
by: Sweety | last post by:
plz reply, thanks in advance. bye
6
2771
by: Anamika | last post by:
I am doing a project where I want to generate random numbers for say n people.... These numbers should be unique for n people. Two people should not have same numbers.... Also the numbers should not be repeted.. Do anyone have some nice algorithm for that? Or anyone can suggest me any type of book or site for that purpose?
24
7207
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 uniformly distributed and unique numbers ?
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.