Puntoinfinito

Generador de numeros aleatorios

Aug 25th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int numero, maximo;
  5.  
  6. int main()
  7. {
  8.     cout << "\n Indica el maximo numero aleatorio que puede sacar\n >>> ";
  9.     cin >> maximo;
  10.     numero = rand() % maximo;
  11.     cout << " Numero aleatorio generado: " << numero;
  12.     cin.sync();
  13.     cin.get();
  14.     main();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment