expected primary expression before void?

closed account (28RDSL3A)
why is that like that? i think my program looks right in the void.....but there an error saying expected primary expression before void..expected";"before void..

help help pls..tnx





#include <iostream>
#include <conio.h>
#include <windows.h>
#include <string.h>


using std:: string;
using namespace std;

void displayMonths();
void dependent();

main()
{
int tin, stat;
string name;
char dep;
int numdep;
int a,b;




cout<<"Tax Payers Name: ";
getline (cin, name);
cout<<"TIN Number: ";
cin>> tin;

cout<<endl<<"[1] Single"<<endl<<"[2] Head of the Family"<<endl<<"[3] Married"<<endl;
cout<<"Exemption Status: "<<endl;
cin>> stat;


if (stat==3)
{
dependent();
displayMonths();
return 0;
}

if (stat==2 || stat==1)
{
dependent();
displayMonths();
return 0;
}


void dependent()
{
if(dep=='Y' || dep=='y')
{
cout<<endl<<"How many dependents you have?";
cin>> numdep;

if(numdep>=5)
cout<<"You're not qualified for children exemptions.";
else if(numdep<=4)
cout<<"You're qualified for exemptions.";
}
if(dep=='N' || dep=='n')
cout<<"Youre Not qualified for children exemptions.";
return dependent;

}

void displayMonths()
{
string months[12]={"JANUARY Salary:","FEBRUARY Salary:","MARCH Salary:","APRIL Salary:","MAY Salary:","JUNE Salary:","JULY Salary:","AUGUST Salary:","SEPTEMBER Salary:","OCTOBER Salary:","NOVEMBER Salary:","DECEMBER Salary:"};
int input1[12];
int a=0;
int input2[12];
int b=0;
double total[12];

for(int x=0;x<12;x++)
{
cout<<months[x];
cin>>input1[a];
a++;
cout<<"Deducted Tax:";
cin>>input2[b];
b++;
for(int c=0;a<=12;a++)
{
total[c]=input1[a-1]+input1[-2];

cout<<"Total is:"<<total[c];
return displayMonths

}
}
}

getch();

}
main() must return an int so:

int main() and

return 0; at the end of function main.

Start with that, you have other errors in your code.
closed account (28RDSL3A)
ah thanks.. yah right i have many more to debug..like the void displaymonths is not working right.. help more please..tnx
Topic archived. No new replies allowed.