Program w wykorzystaniem VOID - losowanie i wypisywanie liczb z zastosowaniem funkcji
#include<iostream>
#include<cstdlib>
#include<time.h>
using namespace std;
int n=2;
void los (int t[])
{
int i;
for(i=0; i<n;i++)
t[i]=rand()%100;
}
void wypisz (int t[])
{
int i;
for(i=0; i<n;i++)
cout<< t[i]<<" ";
cout<<endl;
}
int main()
{
n=10;
int t[n];
srand(time(NULL));
los(t);
wypisz(t);
los(t);
wypisz(t);
los(t);
wypisz(t);
}
