Comecei a aprender hoje subprogramação e estou com algumas dificuldades.. Preciso resolver este exercicios, alguem pode dar uma força?
Faça uma função que ao serem passados como parâmetros um ano e um mês, seja
retornado quantos dias existem naquele mês (cuidado com ano bissexto).
Program p6 ; 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 begin if (mes = 01) then aux:= 31; if (mes = 02) then aux:= 29; if (mes = 03) then aux:= 31; if (mes = 04) then aux:= 30; if (mes = 05) then aux:= 31; if (mes = 06) then aux:= 30; if (mes = 07) then aux:= 31; if (mes = 08) then aux:= 31; if (mes = 09) then aux:= 30; if (mes = 10) then aux:= 31; if (mes = 11) then aux:= 30; if (mes = 12) then aux:= 31; end; writeln('O mes ',mes,' do ano de ',anoX,'possui ',aux,'dias. '); end.