Create a program that will call rand() function plus 5 and prints its return value 13 times on the screen using a for loop.
#include <iostream>
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
using namespace std;
int main(){
srand (time(NULL));
for(int i=0;i<13;i++){
int number= rand() % 100;
number+=5;
cout<<number<<"\n";
}
system("pause");
return 0;
}
Comments
Leave a comment