The date August 10 1980 is a Magic Date,because the month times the day equals to the last two digit of year if we write date in given format (08/10/1980).
C++ Program to Check Magic Date
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include<iostream> using namespace std; int main() { int month,day,year; cout<<"Enter Month Number :"; cin>>month; cout<<"Enter day number :"; cin>>day; cout<<"Enter last two digits of Year :"; cin>>year; if(month*day==year) cout<<"This Date is a Magic Date."; else cout<<"This date is not a Magic Date."; return 0; } |