سورس کد برنامه تشخیص سن پیشرفته و هوشمند به زبان سی پلاس پلاس.
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int currentyear,birthyear;
cout<<"Enter Current Year: ";
cin>>currentyear;
cout<<"Enter Your Birth Year: ";
cin>>birthyear;
int age;
age = currentyear - birthyear;
if (birthyear >= currentyear)
{
cout<<"\n------------------\nError! This Is Impossible!";
}
else
{
if (age >= 120)
{
cout<<"\n------------------\nError! Your Age Is More Than 120! This Is Impossibel!";
}
else
{
cout<<"\n------------------\nYour Age: "<<age;
}
}
getch();
}