Created
February 22, 2016 19:29
-
-
Save andrelramos/dfbb996228082b6689da to your computer and use it in GitHub Desktop.
Exibe o número de dias existentes entre 2 anos digitados pelo usuário
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Program Dias ; | |
| Var | |
| ano, ano_inicio, ano_fim, range, bissextos: integer; | |
| Begin | |
| write('Digite o ano inicial: '); | |
| readln(ano_inicio); | |
| write('Digite o ano final: '); | |
| readln(ano_fim); | |
| range:= ano_fim - ano_inicio; | |
| bissextos:= 0; | |
| for ano:= ano_inicio to ano_fim do begin | |
| if(ano mod 4 = 0) and (ano mod 100 <> 0) or (ano mod 400 = 0) then begin | |
| bissextos:= bissextos + 1; | |
| end; | |
| end; | |
| writeln('A quantidade de dias é: ', range * 365 + bissextos); | |
| End. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment