Problem with functions

Well. I'm trying to create a program in which a user can pick how many will be playing, ask for each players name ask each user how many tickets to pick, then how many numbers the user wants to display.

the code works just fine.

I'm just having trouble dividing it into 2 functions. userInput(), userOutout();

any help would be greatly appreciated

#include <iostream>
#include <cstdlib>
#include <ctime>


using namespace std;


const int size = 20;
int numPlayers[size];
int quickNum[size];
int length[size];

int main ()
{

cout<<"How many players will be playing?"<<endl;
cin>>numPlayers[size];
for(int a=0; a<numPlayers[size]; a++){
cout<<"What is your name player # "<<a+1<<"?"<<endl;
string name;
cin>>name;
cout<<"Hello "<<name<<" how many quick picks will u be playing today?"<<endl;
cin>>quickNum[size];
for(int b=0; b<quickNum[size]; b++){
cout<<"What should the length of quick pick # "<<b+1<<" be"<<endl;
cin>>length[size];
cout<<"Your numbers are: ";
srand((unsigned)time(0));
int random_integer;
for(int index=0; index<length[size]; index++){
random_integer = (rand()%99)+1;
cout << random_integer<<" ";
}
cout<<endl;
}
}
}


Please use the code tags to maintain the formatting of your code. It takes time to read when unformatted.
This is a duplicate post
Topic archived. No new replies allowed.