fork download
  1. //George Molinero csc5 chapter 4, P. 220, #3
  2. //
  3. /*******************************************************************************
  4.  *
  5.  * Determine Magic Date
  6.  * _____________________________________________________________________________
  7.  * This program determines whether or not the entered date is special.
  8.  * _____________________________________________________________________________
  9.  * INPUT
  10.  * Month : Month inputed
  11.  * Day : Day inputed
  12.  * Year : Year inputed
  13.  *
  14.  * OUTPUT
  15.  * Display if date is special or not
  16.  ******************************************************************************/
  17. #include <iostream>
  18. using namespace std;
  19.  
  20. int main()
  21. {
  22. int Month;
  23. int Day;
  24. int Year;
  25.  
  26. cout << "Enter a month (1-12):";
  27. cin >> Month;
  28. cout << endl;
  29. cout << "Enter a day (1-31):";
  30. cin >> Day;
  31. cout << endl;
  32. cout << "Enter a two-digit year:";
  33. cin >> Year;
  34. cout << endl;
  35.  
  36. if (Month * Day == Year)
  37. cout << "The date is magic!" << endl;
  38. else
  39. cout << "The date is not magic." << endl;
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0s 5304KB
stdin
6
10
60
stdout
Enter a month (1-12):
Enter a day (1-31):
Enter a two-digit year:
The date is magic!