/* Programmed by http://cppexamples.blogspot.com
https://www.facebook.com/cppexamples
Simple and easy coding for beginners*/
#include<iostream>#include<conio.h>using namespace std;int main(){ int day,month,year,cday,cmonth,cyear,tyear,tmonth,tday,leap=0; cout<<"Enter your date then month then year of birth : "; cin>>day>>month>>year; cout<<"Enter current date , month than year: "; cin>>cday>>cmonth>>cyear; tyear=cyear-year; tmonth=12*tyear; tday=365*tmonth; for ( ; year<=cyear ; year++) //this loop is calculating the leap years which came in your life { if (year%4==0) leap++; } tday+=leap; cout<<"Your number of days from birth to current date are: "<<tday<<endl; return 0; getch();}
https://www.facebook.com/cppexamples
Simple and easy coding for beginners*/
#include<iostream>#include<conio.h>using namespace std;int main(){ int day,month,year,cday,cmonth,cyear,tyear,tmonth,tday,leap=0; cout<<"Enter your date then month then year of birth : "; cin>>day>>month>>year; cout<<"Enter current date , month than year: "; cin>>cday>>cmonth>>cyear; tyear=cyear-year; tmonth=12*tyear; tday=365*tmonth; for ( ; year<=cyear ; year++) //this loop is calculating the leap years which came in your life { if (year%4==0) leap++; } tday+=leap; cout<<"Your number of days from birth to current date are: "<<tday<<endl; return 0; getch();}
0 Questions:
Post a Comment