Facebook
From Mateusz Rojek, 3 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 84
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  6.  
  7. void funkcja3(int cel[]) {
  8.         for (int i = 0; i < 10; i++) {
  9.                 cel[i] = rand();
  10.         }
  11. }
  12.  
  13. int main(int argc, char** argv) {
  14.         int tablica[10];
  15.         funkcja3(tablica);
  16.        
  17.         cout << "Zawartosc twojej tablicy: ";
  18.         for (int i = 0; i < 10; i++) {
  19.                 if (i != 9) {
  20.                         cout << tablica[i] << ", ";
  21.                 } else {
  22.                         cout << tablica[i];
  23.                 }
  24.         }
  25.        
  26.         return 0;
  27. }
  28.