KingaGolas

Zad 2.8

Apr 16th, 2020
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cstdlib>
  4. #include <ctime>
  5.  
  6. using namespace std;
  7.  
  8. void tabela(int tablica[])
  9. {
  10. srand(time(NULL));
  11. for (int i=0; i<10; i++)
  12. {
  13. tablica[i]=1+rand()%(50-1+1);
  14. }
  15. for(int i=0; i<10; i++)
  16. {
  17. cout<<tablica[i]<<" ";
  18. }
  19. }
  20.  
  21. int main()
  22. {
  23. int tablica[10];
  24. tabela (tablica);
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment