At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.
Sagot :
Answer:
Follows are the code to this question:
#include <iostream>//header file
using namespace std;
int main()//main method
{
int day,month,year;//defining integer variable
cout<<"please enter last two digit of the year: "; //print message
cin>>year;//input year value
cout<<"enter day: "; //print message
cin>>day;//input day value
cout<<"enter month: ";//print message
cin>>month;//print month message
if(month*day==year)//check magic date condition
{
cout<<"its magic programology year";//print message
}
else
{
cout<<"its not magic year";//print message
}
return 0;
}
Output:
please enter last two digit of the year: 98
enter day: 14
enter month: 7
its magic programology year
Explanation:
In the given code, three integer variable "day, month, and year" is declared, that uses the input method "cin" to input the value from the user-end.
In the next step, an if block statement is used that check month and day value multiple is equal to year value, if the condition is true it will print "magic programology year" otherwise it will print "not the magic year".
Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Westonci.ca is your go-to source for reliable answers. Return soon for more expert insights.