Summer training at Goeduhub Technologies-Jaipur
Online FREE Certified Workshop on Python Programming:: Active now ||  Career options for aspiring CS/ITECEEE or EIC or EEE Engineers
0 like 0 dislike
184 views
in Examples, Exercises and Projects by Goeduhub's Expert (6.9k points)
Expected Output:

Input a year: 2019                                                      

Input a month [1-12]: 08                                                

Input a day [1-31]: 23                                                  

The next date is [yyyy-mm-dd] 2019-8-24

1 Answer

0 like 0 dislike
by Goeduhub's Expert (6.9k points)
 
Best answer
d=int(input("ENTER THE DAY : "))

m=int(input("ENTER THE MONTH : "))

y=int(input("ENTER THE YEAR : "))

 

if ((y % 4 == 0) and (y % 100!= 0)) or (y%400 == 0):

    if m==2:

        d1=29

    elif m==1 or m==3 or m==5 or m==7 or m==8 or m==10 or m==12:

        d1=31

    else :

        d1=30

else:

    if m==2:

        d1=28

    elif m==1 or m==3 or m==5 or m==7 or m==8 or m==10 or m==12:

        d1=31

    else :

        d1=30

if d==31 and m==12 :

    d=1

    m=1

    y=y+1   

elif d1-d==0 :

    m=m+1

    d=1

else:

    d=d+1

    

print("NEXT DAY IS : ",d,"/",m,"/",y)

Related questions

 Go to your Branch CSE or IT | ECE | EE, EIC or EEEMECE
 Know About Popular Colleges/Universities  List of IITsList of NITs | RTU-KOTA | Manipal University-Jaipur | JECRC University | Amity University Jaipur | BIT Mesra-Jaipur | MODY UNIVERSITY | LNMIIT-Jaipur | JK Lakshmipat | Banasthali Vidyapith | POORNIMA University
 Exams:   List of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG) | JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs
Placements:  List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
 Online Free Training:  Artificial Intelligence(AI) & Machine Learning(ML)Python Programming | Internet of Things-IoT | OpenCV (Open Source Computer Vision Library) | LINUX | Big Data : Hadoop | 
 Goeduhub
About Us | Contact Us   Social::   |  | 
...