--- In [email protected], "Devils Call me Grand Paa" 
<[EMAIL PROTECTED]> wrote:
>
> Write a complete program that determine the day number (1to 366) 
in a 
> year for a date that is provided as input in the format dd-mm-
yyyy  as 
> an example 01-01-2000 is day 1.31-12-2001 is the day 365.31-12-
2000 is 
> day 366 because 2000 is leap year. A year is leap year if it is 
> divisible by 4. You may assume that user has entered input in the 
> correct format that is valid date.
>
// tha t is my solution but it inot completl write
#include<iostream>
using namespace std;
void main()
{
        int x,year,month,day,arry=
{31,28,31,30,31,30,31,31,30,31,30,31};
        cout<<"please enter the year";
        cin>>year;
        cout<<"please enter the month";
        cin>>month;
        cout<<"please enter the day";
        cin>>day;
        if(year%400==0)
        {
                x=1;
        }
        for (int i=0;i<month-1<<i++);
        {
                if(x==1&&i==1)
                {
                        result=result+arry[i]+1;
                }
                else
                {
                        result=result+arry[i];
        }
                {
                        result=result+date;
                        {
                                cout<<day;
                }
}


Reply via email to