function to find out for many days have passed since last birthday.need help.
Hello,
I have to write a c++ program with my own function which consists of two parametrs (day, month). Function have to return number of days since the begining of this year. Using this function i have to find out how many days are left till birthday (or how many days have passed since last birthday)
This is how far i am:
Code:
#include <iostream>
using namespace std;
int cikDienu(int diena, int menesis);
int main()
{
int dd = 0;
int mm = 0;
int birthday = 0;
int birthmonth = 0;
int fromYearBegining = 0;
cout << "Enter todays date: "<< endl;
cout << "day: " << endl;
cin >> dd;
cout << "month: " << endl;
cin >> mm;
cout << "Enter your birthday: "<< endl;
cout << "day: " << endl;
cin >> birthday;
cout << "month: " << endl;
cin >> birthmonth;
cout << "From this year begining have passed " << cikDienu(dd) << " days" << endl;
return 0;
}
int cikDienu(int diena, int menesis){
int fromyear;
int howmuch;
howmuch=fromyear - 365;
return howmuch;
}