I'm having trouble with my lab for a computer class. The problem is as stated:
Design a program that generates 100 random numbers, and keeps a count of how many of those random numbers are even and how many are odd.
Try not to over think the problem. You should only need 4 variables in this problem. even, odd, randNum, and i. Variable i is used to control the for loop, randNum is used to hold a random number for even or odd comparison, even and odd are incremented based on the comparison of the randNum. Then print your results to the console. Also what type of computer course are you taking?
dude just combine everything snippsat posted he basically wrote you the programme it's right there, just think about it
create a loop from 1 to 100
generate random number and store in a variable
if the number is odd add 1 to odd variable
else add 1 to even variable
print odd and even variables