+ 1

Can someone explain why this isin't working?

it gives a value bigger than the maximum one

9th Dec 2016, 4:44 PM
Bogdan Bruma
1 Respuesta
+ 1
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { int y,x,z; cout<<"Input the minimal value"<<endl; cin>>y; cout<<"Input the maximum value"<<endl; cin>>x; srand(time(0)); cout<<y+(rand()%x); return 0; }
9th Dec 2016, 4:45 PM
Bogdan Bruma