Skip to content

Instantly share code, notes, and snippets.

@oca159
Forked from codepainkiller/num_aleatorios.cpp
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save oca159/9b72019bbb81b1bc0540 to your computer and use it in GitHub Desktop.

Select an option

Save oca159/9b72019bbb81b1bc0540 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <time.h>
#include<iostream>
using namespace std;
int main()
{
int num, c;
srand(time(NULL));
for(c = 1; c <= 10; c++)
{
num = 1 + rand() % (11 - 1);
cout << num<< " ";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment