Write your question here.
I have to write a C++ program that picks a random number between 0 and 49. If the number is even lets say 30, then the computer will display 30, 32, 34, 36... all the way till 100, if its odd lets say 17, then the computer will display 17, 19.. till 99. I got the computer picking a random number, I just can't figure out how to display every other number using a for loop statement. Here's my code for random number generator:
This is what I have so far, and how is the computer going to know if its even or odd i don't understand how to implement that and how to display every other number.
I tried using the do while loop to run it again but it gave me this error:
1 2 3 4 5 6 7
test4.cpp: In function ‘int main()’:
test4.cpp:20: error: expected ‘;’ before ‘)’ token
test4.cpp:24: error: expected ‘;’ before ‘cin’
test4.cpp:34: error: ‘re_do’ was not declared in this scope
test4.cpp:35: error: ‘re_do’ was not declared in this scope