Microchip PIC program problem

Status
Not open for further replies.

Even though it's not the most uniform solution, The OP could have just done the following:
Code:
result = rand()%10; // generate a random value from 0 to 9

That is easier to understand and produces only numbers from 0-9 without having to deal with runs of results outside that range.
 

Hi. thanks for your help. It works!
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…