|
-
Mar 11th, 2002, 10:13 PM
#1
Thread Starter
Addicted Member
Can u fix this?
// Rob Gross
// Midterm
// 3/11/02
// Due Thursday
#include <iostream>
using namespace std;
int main ()
{
int days [12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int difference;
int fmonth;
int fdate;
int smonth;
int sdate;
cout << "Enter your first Month and Date: " << endl;
cin >> fmonth >> fdate;
cout << "Enter your second Month and Date: " << endl;
cin >> smonth >> sdate;
difference = (days [fmonth - 1] - fdate);
cout << difference << " days between the dates. " << endl;
return 0;
}
My computer crashes on this line
difference = (days [fmonth - 1] - fdate);
what is wrong is that I have it set to nothing.
The point of this project is to calculate the number of days that the user enters when they enter a month and a date twice.
You understand?
ICQ = 20476917
AIM = Butnud
Lets Talk!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|