CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
int main() {
int r;
cout<<"This 10 random values are consistance if you run this code multipal times"<<endl;
for(int i=0; i<10; i++)
{
r=rand();
cout<<r<<" ";
}
cout<<endl<<endl<<"This 10 values are guarenteed to be truly random for every run"<<endl;
srand(time(0));
for(int i=0; i<10; i++)
{
r=rand();
cout<<r<<" ";
}
return 0;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run