Advertisement
FAMDS

PC 2 - ex1

Feb 14th, 2023
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int ano, resto, resto2;
  6.  
  7. printf("Informe o ano \n");
  8. scanf("%d",&ano);
  9.  
  10. resto=ano%400;
  11. if (resto==0){
  12. printf("O ano informado é bissexto");}
  13. else{
  14.  
  15. resto=ano/4;
  16. resto2=resto%100;
  17. if(resto2==1){
  18. printf("O ano informado é bissexto");}else
  19. {printf("O ano informado não é bissexto");
  20. }
  21. }
  22. return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement