Jump to content

Premium Script Giveaway!


Maldesto

Recommended Posts

fix plz

#include <iostream>
using namespace std;


int  dateToNumber (int day, int month)
{
int x = 0;
x = x + day;
if (month>= 1)
{
x = x + 31;
}
else if (month>= 2){
x = x + 28;
}
else if (month>= 3){
x = x + 31;
}
else if (month>= 4){
x = x + 30;
}
else if (month>= 5){
x = x + 31;
}
else if (month>= 6){
x = x + 30;
}
else if (month>= 7){
x = x + 31;
}
else if (month>= 8){
x = x + 31;
}
else if (month>= 9){
x = x + 30;
}
else if (month>= 10){
x = x + 31;
}
else if (month>= 11){
x = x + 30;
}
else if (month > 12){
x = x + 31;
}
x--;
return x;
}


int main() {
int day=0;
int month=0;
cout << "Please: Enter the Day: "<< endl;
cin >> day;
cout << "Please: Enter the Month: "<< endl;
cin >> month;
month = month - 1;
int x = 0;
x=dateToNumber(day, month);
cout << "The total amount of days are: " << x <<endl;


return 0;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...