I am new to C++ and I am writing a program that will create 100 random numbers and split them by odd and even. I think I have the code correct but I keep getting this error:
error C2440: '=' : cannot convert from 'void' to 'int'
Here is the program:
Code:#include <iostream> using namespace std; void main() { int i, num, even, odd; for(i = 0; i < 100; i++) { num = srand(i); } if ( num % 2 == 0 ) even = num; else; odd = num; } // main