could someone tell me what the error i am making is and how to fix it and thank you
#include <iostream.h>
#include <math.h>
#include <string.h>
const int ArSize = 20;
int next(int age, int year);
void another(int count);
int main()
{
int age;
int year;
cout <<"How old are you?\n";
cin>>age;
cout<<"Want to know if i can tell you what year you were born?\n";
char respond [ArSize];
cin.get();
cin>>respond;
if (strcmp(respond,"y")==0 || strcmp(respond, "Y")==0 || strcmp(respond,"Yes") || strcmp(respond,"yes"))
{
year = 2001 - age;
cout<<"you were born in "<<year<<". see arent i smarter than you think ;p\n";
}
cout<<"Lets demonstrate function calling now shall we since what we jus did was \n declare variables manipulate them and use them \n";
next(age, year);
return 0;
}
int next(int age,int year)
{
cout<<"see here we are in this function called next which is going to \n remeber your age from the last function\n" ;
cout<<"see your age is "<<age<<" and you were born in " << year << " \n";
cout <<"but lets ask some more ?'s and demonstrate more things shall we not that \n you have a choice in the matter\n";
another(4);
return 0;
}
void another(int count)
{
cout<<"Ill give you a value to be displayed counted forward and backwards\n";
cout<<endl<<cout;
if (count >0)
another(count - 1);
cout<<"maybe that plan didnt work i couldnt get it to work right \n but that demonstrates high error rates in programming so im gonig to leave it in\n";
int now;
cout<<"pick a number\n";
cin.get();
cin>>now;
cout<<"now im going to use a do while statement and then explain it\n";
do
{
cout<<"math is fun";
cout<<"at this point i dont remeber your age and year of birth because i didnt \n carry it over\n";
cout<<"im going to display this text over and over until ur number is up to 100000\n";
}
while (now < 100000);
{
for ( int i = now;i > 100000;i++)
cout << i<<;
cout<<endl;
}
cout<<"now wasnt that fun now there is one more control statement\n";
int t;
cout<<"pick the magic number \n";
cin.get();
cin>>t;
switch (t)
{
case 8:
cout<<"you got it good job\n";
break;
}
cout<<"well this was fun but im going to end it now so good night since im writing this at night\n";
}
--------------------Configuration: skkoool - Win32 Debug--------------------
Compiling...
skkoool.cpp
C:\skkoool.cpp(57) : error C2059: syntax error : ';'
Error executing cl.exe.
skkoool.obj - 1 error(s), 0 warning(s)