Write a program that determines the day number (1 to 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 day 365. 31-12-2000 is day 366 because 2000 is the leap year. A year is a leap year, if it is divisible by 4. You may assume that user has entered input in correct format and that is a valid gate.
#include <iostream>
using namespace std;
void main ()
{
string astring;
int b;
cout<<"enter the date in format dd-mm--yyyy";
cin>>astring;
if (astring.at(2)==0) && (astring.at(3)==1)
b=astring.at(0)*10+astring.at(1)
else
b=astring.at(0)*10+astring.at(1)
please tell me what should i do to make it full program please help me. it is in C++.
thanks.