diff --git a/du3/program.c b/du3/program.c index b2d1e90..c5c1e35 100644 --- a/du3/program.c +++ b/du3/program.c @@ -6,7 +6,6 @@ int ValidateTime(int dd , int mm , int yy) { - int res = 0; if(yy>=1900 && yy<=9999) { //check month @@ -14,26 +13,25 @@ int ValidateTime(int dd , int mm , int yy) { //check days if((dd>=1 && dd<=31) && (mm==1 || mm==3 || mm==5 || mm==7 || mm==8 || mm==10 || mm==12)) - res = 1; + return 1; else if((dd>=1 && dd<=30) && (mm==4 || mm==6 || mm==9 || mm==11)) - res = 1; + return 1; else if((dd>=1 && dd<=28) && (mm==2)) - res = 1; + return 1; else if(dd==29 && mm==2 && (yy%400==0 ||(yy%4==0 && yy%100!=0))) - res = 1; + return 1; else - res = 0; + return 0; } else { - res = 0; + return 0; } } else { - res = 0; + return 0; } - retrun res; } int main()