Unformatted text preview: Computer Question 3: Write a program that generates a random integer in the range of 1 to 100 and asks the user to guess the number. You program should keep asking the user for guesses until it is correct. For each incorrect guess, you program should hint if the guess is larger or smaller than the random number you generated. Computer Question 4: Write a function called myISPRIME . Your function should take one input argument and mirror the functionality of the built-in isprime function—return 1 if the input number is prime, and 0 otherwise. Hint: a prime number is divisible only by 1 and itself. Loop through all of the numbers in between “1 and itself” and use the rem function to see if you find any numbers that divide the input evenly. You may not use primes, isprime , or similar functions as part of your solution....
View Full Document
- Fall '09
- Prime number, Remote control, channel number, final menu item, TV remote control, built-in isprime function—return