View Code of Problem 28

#include<stdio.h>
main(){
  int a;
  int b;
  scanf("%d",&a);
  scanf("%d",&b);
  if(a%4==0&&a%100!=0||a%400==0){
    printf("Leap Year");}
  else{printf("Not Leap Year");}
  if(b%4==0&&b%100!=0||b%400==0){
    printf("Leap Year");}
  else{printf("Not Leap Year");}
/*
Main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main(){
 ^~~~
Main.c: In function 'main':
Main.c:7:12: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(a%4==0&&a%100!=0||a%400==0){
      ~~~~~~^~~~~~~~~~
Main.c:10:12: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(b%4==0&&b%100!=0||b%400==0){
      ~~~~~~^~~~~~~~~~
Main.c:12:3: error: expected declaration or statement at end of input
   else{printf("Not Leap Year");}
   ^~~~
*/

Double click to view unformatted code.


Back to problem 28