How do I get rid of these errors?Its supposed to calculate your age based on your birth year. This code was made by me and my friend,both of us are begginers in programming.
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofargs, char* pszArgs[]);
int CurrentYear = 2020;
int BirthYear;
cout << "Enter your birth year: "
cin >> BirthYear;
if (nBirthYear <= 0)
{
cout << "Birth year cannot be processed" <<endl;
BirthYear = 2020
}
else (BirthYear > 2020)
{
cout << "Birth year cannot be processed " <<endl;
BirthYear = 2020
}
if (nBirthYear < 2020)
(cout << "Your age is : " << CurrentYear - BirthYear <<endl;
)
cout << "Press Enter to continue..." << endl;
cin.ignore(10, '\n');
cin.get();
return 0;
these are the errors
||=== Build: Debug in Actualagefinder (compiler: GNU GCC Compiler) ===|
H:\c++\Actualagefinder\main.cpp|13|error: 'cout' does not name a type|
H:\c++\Actualagefinder\main.cpp|16|error: expected unqualified-id before 'if'|
H:\c++\Actualagefinder\main.cpp|21|error: expected unqualified-id before 'else'|
H:\c++\Actualagefinder\main.cpp|26|error: expected unqualified-id before 'if'|
H:\c++\Actualagefinder\main.cpp|28|error: expected unqualified-id before ')' token|
H:\c++\Actualagefinder\main.cpp|30|error: 'cin' does not name a type; did you mean 'main'?|
H:\c++\Actualagefinder\main.cpp|31|error: 'cin' does not name a type; did you mean 'main'?|
H:\c++\Actualagefinder\main.cpp|32|error: expected unqualified-id before 'return'|
||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|