Nightfire
03-30-2003, 05:09 PM
Can anyone see why this always shows the random number as 99?
#include <iostream>
#include <windows.h>
int main(){
int x = 1;
int y = 99;
std::cout << "A random number between " << x << " and " << y << " is: " << rand()%x+y;
return 0;
}
#include <iostream>
#include <windows.h>
int main(){
int x = 1;
int y = 99;
std::cout << "A random number between " << x << " and " << y << " is: " << rand()%x+y;
return 0;
}