(você precisa declarar a varialvel aux:=0;)
program p6 ;
uses crt;
procedure auxiliar (var bissexto:boolean; ano:integer);
begin
if (ano mod 400=0) then
bissexto:=true;
if (ano mod 4=0) and (ano mod 100 <> 0) then
bissexto:=true
else
bissexto:=false;
end;
var
mes,aux,anoX:integer;
biss:boolean;
begin
writeln('Entre com o ano: ');
readln(anoX);
auxiliar (biss,anoX);
writeln('Entre com o mes: ');
readln(mes);
if (mes) > 12 then
writeln ('Mes invalido');
if (mes) <= 12 then
begin
if (biss=false) and (mes = 2) then
aux:=28;
end
else
aux:=0;
begin
if (mes = 01) then
aux:= 31
else if (mes = 02) then
aux:= 29
else if (mes = 03) then
aux:= 31
else if (mes = 04) then
aux:= 30
else if (mes = 05) then
aux:= 31
else if (mes = 06) then
aux:= 30
else if (mes = 07) then
aux:= 31
else if (mes = 08) then
aux:= 31
else if (mes = 09) then
aux:= 30
else if (mes = 10) then
aux:= 31
else if (mes = 11) then
aux:= 30
else if (mes = 12) then
aux:= 31;
end;
writeln('O mes ',mes,' do ano de ',anoX,' possui ',aux,' dias. ');
readkey;
end.