Skip to content

Write a program that tests the effectiveness of the rand( ) function provided by your compiler. Start by initializing 10 counters, such as onescount, twoscount to tenscount, all to 0. Then generate a large number of random integers between 1 and 10. Each time a 1 occurs, increment onescount; when a 2 occurs, increment twoscount; etc. Finally, pr…

Notifications You must be signed in to change notification settings

MizanMustakim/the-test-of-effectiveness-of-the-rand-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

the test of effectiveness of the rand function

Write a program that tests the effectiveness of the rand( ) function provided by your compiler. Start by initializing 10 counters, such as onescount, twoscount to tenscount, all to 0. Then generate a large number of random integers between 1 and 10. Each time a 1 occurs, increment onescount; when a 2 occurs, increment twoscount; etc. Finally, print out the number of 1s,2s,etc. that occurred and the percentage of the time each number occurred.

About

Write a program that tests the effectiveness of the rand( ) function provided by your compiler. Start by initializing 10 counters, such as onescount, twoscount to tenscount, all to 0. Then generate a large number of random integers between 1 and 10. Each time a 1 occurs, increment onescount; when a 2 occurs, increment twoscount; etc. Finally, pr…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages