Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Generating Random Number of 0-7 range

Status
Not open for further replies.

ryusgnal

Advanced Member level 4
Joined
Oct 4, 2005
Messages
102
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Location
Malaysia
Activity points
1,992
Generating Random Number

Hi,

If I want to generate random number between 0 to 7. How?

Thank you.
 

AlexBaraba

Junior Member level 1
Joined
Apr 3, 2008
Messages
19
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,283
Activity points
1,403
Re: Generating Random Number

You didn`t give much details.

this is code for c language :


#include <stdlib.h>

void main()
{
int randomNumber;

randomNumber = rand() % 8;

//
// do proccessing of random number ...
//
}
 

    ryusgnal

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top