I need some help translating this random number generator in C#. Not so much the output and the for loop structure and what not, but basically how the cstdlib, and ctime would translate to C#, and the srand((unsigned)time(0)); Can anyone help me out?
C++ Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand((unsigned)time(0));
int n = 0, k = 0;
// Roll 30 Times.
for (k = 0;k < 30;k++)
{
// Get the random number
n = (rand() % 4);
cout << n << endl;
}
return 0;
}