#include <iostream>
#include <cstdio>
#include <cstdlib>
usingnamespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
int nMonth;
cout << "Please Enter the day and Month";
cin >> nMonth;
}
switch (nMonth)
{
case 1/1:
cout << "Its the first of January" << end1;
break;
case 2/1:
cout << "Its the second of January" << end1;
break;
default:
caut << " The date you entered is not valid"
<< " Restart and try again"
<< "Remember the format must be dd/mm"
system ("pause");
return 0;
}
1. Line 11, delete that }. That is saying "end the main function" which is not what you want to do.
2. Line 23, caut isn't a function :P
3. Line 26 needs a } to end the switch statement.
#include <iostream>
#include <cstdio>
#include <cstdlib>
usingnamespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
int nMonth;
cout << "Please Enter the day and Month";
cin >> nMonth;
switch (nMonth)
{
case 1/1:
cout << "Its the first of January" << end1;
break;
case 2/1:
cout << "Its the second of January" << end1;
break;
default:
cout << "This is not valid input"
<< " Restart and try again"
<< "Remember the format must be dd/mm" <<end1;
}
system ("pause");
return 0;
}
But i get get fallowing error at line 17
1 2
error: 'end1' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|