Unformatted text preview: Built in functions Assignment 23 There is a builtin funct ion called rand which returns a pseudorando m number. The problem is that the range of that number is often too large to be the kind o f rando m numbers we need. For example, we might want a number from 1 to 100, but the rand funct ion gives us numbers way out of that range. Write a program that generates 10 pseudorandom numbers between 1 and 100 and displays them on the screen. Note: you can not just keep generating them and throwing them away if they are out of range. Also note: if you use the modulus operator (%) you will be able to figure this out. The fo llo wing is an example – your answers will probably be different. ...
View Full Document
This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Penn State.
- Summer '07