I am brand new to programing and am trying to write a C++ program that calculates how many days are left to a persons birthday. I need to make a function for the leap years, and to get number of days in a month, i have no idea how to do this. any help would be great..
i am using windows op, with visual studios 2005
this is what i have so far.
[CODE=cpp]#include <iostream>
using namespace std;
int getdate (int& day, int& month, int& year);
int main ()
{
int day, month, year;
getdate (day, month, year);
cout << "The date you enterd is:\n";
cout << day <<endl << month <<endl << year <<endl;
return 0;
}
int getdate (int& day,int& month,int& year)
{
cout << "Please enter your birth day\n";
cout << "Day: ";
cin >> day;
cout << "Month (ex 4): ";
cin >> month;
cout << "year: ";
cin >> year;
return day, month, year;
}[/CODE]
i am using windows op, with visual studios 2005
this is what i have so far.
[CODE=cpp]#include <iostream>
using namespace std;
int getdate (int& day, int& month, int& year);
int main ()
{
int day, month, year;
getdate (day, month, year);
cout << "The date you enterd is:\n";
cout << day <<endl << month <<endl << year <<endl;
return 0;
}
int getdate (int& day,int& month,int& year)
{
cout << "Please enter your birth day\n";
cout << "Day: ";
cin >> day;
cout << "Month (ex 4): ";
cin >> month;
cout << "year: ";
cin >> year;
return day, month, year;
}[/CODE]
Comment