The tutorial displays the following code on how to generate random numbers...
Code:
#include <stdlib.h> //for rand
#include <stdio.h> //for printf
#include <time.h> //for time
int main(void)
{
srand(time(NULL));
printf("A random number from 0 to 99: %d", rand() % 100);
return 0;
}
My question is: how do i change this snippet so that it uses the cout << thing instead of the printf thing. If this is not possible, please explain why and tell me if I should continue to use the cout << thing or just go with the printf thing.
Thanks
-Chris