program should return valid or invalid, but does not

//DEBUG2 Program
//This program asks the user for an insurance code, then validates it.
//An insurance code between 10 and 99 inclusive is valid.
#include<iostream>
#include<string>
using namespace std;
int main()
{
int insCode;
int valid;
int validateCode(int insCode);
cout<<"\nPlease enter insurance code ";
cin>>insCode;
validateCode(insCode);
if(valid == 1)
{cout<<"\nValid code"<<endl;}
else
cout<<"\nInvalid code"<<endl;

system("pause");
}
int validateCode(int insCode)
{
int valid;
if(insCode>=10 && insCode<=99)
{valid=1;
return(valid);}
else
valid=0;

return(valid);



}
Would you mind explaining how you solved this to help people with the same problem?
Topic archived. No new replies allowed.