Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

emonyi / IAX0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit c04456f7 authored 6 years ago by emonyi's avatar emonyi
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Upload New File

parent 8deebcf5 master
Hide whitespace changes
Inline Side-by-side
Showing with 28 additions and 0 deletions
  • lab2/task2/Calendar.c
lab2/task2/Calendar.c 0 → 100644
View file @ c04456f7
#include <stdio.h>
int main () {
int dd, mm, yy;
printf("Please enter the date dd/mm/yy:\n");
scanf("%d/%d/%d", &dd, &mm, &yy);
int bissextile = yy % 400 == 0 || (yy % 4 == 0 && yy % 100 != 0);
if (dd>31 || dd<1 || mm>12 || mm<1)
printf("Invalid date.\n");
if((mm==2 && dd<30 && bissextile) || (mm==2 && dd<29 && bissextile==0))
printf("valid date.\n");
else
if((mm==4 || mm==6 || mm==9 || mm==11)&& dd<31)
printf("valid date.\n");
else
if(dd<31 && mm!=2)
printf("valid date.\n");
else
printf("Invalid date.\n");
return 0;
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment