I'm having compilation problems. I can't see where my error came from. Can, someone help me? The goal of this code is to ingress a date and to check if it's right.
#include<iostream>
#include<math.h>
#include<cmath>
using namespace std;
int main(){
int d, m, a;
cout << "entrar dia"<<endl;
cin>>d;
cout << "entrar mes"<<endl;
cin>>m;
cout << "entrar ano"<<endl;
cin>>a;
if(d<1 || d>32|| m<1 || m>13 || a<1960 || a>2022) {
cout<<"Fecha incorrecta"<<endl;
else {
if( (m==4 || m==6 || m==9 || m==11) && d>30){
cout<<"Fecha incorrecta"<<endl;
}
}
else {
if((m == 2 && a % 4 = 0 && d > 28) || (m == 2 && a % 4 == 0 && d > 29)) {
cout<< "Fecha incorrecta"<<endl;
}
}
else {
cout <<"Fecha correcta"<<endl;
}
}}
Thanks