0
How do you get random numbers into an array in C?
How do you fill a string with 10 numbers but having those numbers come out in random (numbers between say 1-10)
1 Answer
0
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main () {
srand(time(0));
for (int x = 1; x <=1
//numbers on colomn
; x++) {
cout << 1 + (rand() %
10) << endl;
}
}