SlideShare une entreprise Scribd logo
1  sur  2
The date June 10, is special because when we write in the following format, the month times the
day equal the year: 6/10/60. Write a program that asks the user to enter a moth, a day, and a two
digit year. The program should then determine whether the month times the day is equal to the
year. If so, it should display a message saying the date is magic. Otherwise, it should display a
message saying the date is not magic.
Solution
#include<stdio.h>
#include<iostream.h>
void main()
{ int date, year,magic,month;
cout<<"Enter month";
cin>>month;
cout<<"Enter date";
cin>>date;
cout<<"Enter last two digits of year";
cin>>year;
magic = month*date;
if(magic==year)
{
cout<<"The date is magic";
}
else
cout<<"The date is not magic";
}

Contenu connexe

Plus de lmark1

The balance sheet is the cornerstone of the financial statements- The.docx
The balance sheet is the cornerstone of the financial statements- The.docxThe balance sheet is the cornerstone of the financial statements- The.docx
The balance sheet is the cornerstone of the financial statements- The.docx
lmark1
 
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docxPAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
lmark1
 
Outline the role of the operating system and identify the features of.docx
Outline the role of the operating system and identify the features of.docxOutline the role of the operating system and identify the features of.docx
Outline the role of the operating system and identify the features of.docx
lmark1
 
Organizational Structure Evaluate the decision-making process and its.docx
Organizational Structure Evaluate the decision-making process and its.docxOrganizational Structure Evaluate the decision-making process and its.docx
Organizational Structure Evaluate the decision-making process and its.docx
lmark1
 

Plus de lmark1 (20)

The case notes that Nationwide had in mind a simple goal- but faced a.docx
The case notes that Nationwide had in mind a simple goal- but faced a.docxThe case notes that Nationwide had in mind a simple goal- but faced a.docx
The case notes that Nationwide had in mind a simple goal- but faced a.docx
 
The capital budgeting analytical technique that calculates the rate of.docx
The capital budgeting analytical technique that calculates the rate of.docxThe capital budgeting analytical technique that calculates the rate of.docx
The capital budgeting analytical technique that calculates the rate of.docx
 
The balance sheet is the cornerstone of the financial statements- The.docx
The balance sheet is the cornerstone of the financial statements- The.docxThe balance sheet is the cornerstone of the financial statements- The.docx
The balance sheet is the cornerstone of the financial statements- The.docx
 
The capital account balances for Donald & Hanes LLP on January 1- 2011.docx
The capital account balances for Donald & Hanes LLP on January 1- 2011.docxThe capital account balances for Donald & Hanes LLP on January 1- 2011.docx
The capital account balances for Donald & Hanes LLP on January 1- 2011.docx
 
the bookkeeper of vitial inc has asked to assist him with preparation.docx
the bookkeeper of vitial inc has asked to assist him with preparation.docxthe bookkeeper of vitial inc has asked to assist him with preparation.docx
the bookkeeper of vitial inc has asked to assist him with preparation.docx
 
The balanced scorecard integrates financial and nonfinancial measures.docx
The balanced scorecard integrates financial and nonfinancial measures.docxThe balanced scorecard integrates financial and nonfinancial measures.docx
The balanced scorecard integrates financial and nonfinancial measures.docx
 
The balance sheet for the partnership of Nina- Pinta- and Santa Maria.docx
The balance sheet for the partnership of Nina- Pinta- and Santa Maria.docxThe balance sheet for the partnership of Nina- Pinta- and Santa Maria.docx
The balance sheet for the partnership of Nina- Pinta- and Santa Maria.docx
 
Palindromes A palindrome is a word or phrase that reads the same backw (1).docx
Palindromes A palindrome is a word or phrase that reads the same backw (1).docxPalindromes A palindrome is a word or phrase that reads the same backw (1).docx
Palindromes A palindrome is a word or phrase that reads the same backw (1).docx
 
Palindromes A palindrome is a word or phrase that reads the same backw (2).docx
Palindromes A palindrome is a word or phrase that reads the same backw (2).docxPalindromes A palindrome is a word or phrase that reads the same backw (2).docx
Palindromes A palindrome is a word or phrase that reads the same backw (2).docx
 
Palindromes A palindrome is a word or phrase that reads the same backw.docx
Palindromes A palindrome is a word or phrase that reads the same backw.docxPalindromes A palindrome is a word or phrase that reads the same backw.docx
Palindromes A palindrome is a word or phrase that reads the same backw.docx
 
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docxPAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
PAD601 Comment in detail on the events of each date 1880- 1881- 1883-.docx
 
P5- Use the financial information below to calculate and interpret the.docx
P5- Use the financial information below to calculate and interpret the.docxP5- Use the financial information below to calculate and interpret the.docx
P5- Use the financial information below to calculate and interpret the.docx
 
Pablo own small transportation firm in Latvia- His trucks delivers goo.docx
Pablo own small transportation firm in Latvia- His trucks delivers goo.docxPablo own small transportation firm in Latvia- His trucks delivers goo.docx
Pablo own small transportation firm in Latvia- His trucks delivers goo.docx
 
Over the past weeks we have been examining the inference process- big.docx
Over the past weeks we have been examining the inference process- big.docxOver the past weeks we have been examining the inference process- big.docx
Over the past weeks we have been examining the inference process- big.docx
 
Outline the role of the operating system and identify the features of.docx
Outline the role of the operating system and identify the features of.docxOutline the role of the operating system and identify the features of.docx
Outline the role of the operating system and identify the features of.docx
 
Outline the key issues involved in Open Systems Theory including the f.docx
Outline the key issues involved in Open Systems Theory including the f.docxOutline the key issues involved in Open Systems Theory including the f.docx
Outline the key issues involved in Open Systems Theory including the f.docx
 
Out of the following- which are non separately stated for Neely Inc--.docx
Out of the following- which are non separately stated for Neely Inc--.docxOut of the following- which are non separately stated for Neely Inc--.docx
Out of the following- which are non separately stated for Neely Inc--.docx
 
ou shoot a beam of electrons through a double slit to make an interfer.docx
ou shoot a beam of electrons through a double slit to make an interfer.docxou shoot a beam of electrons through a double slit to make an interfer.docx
ou shoot a beam of electrons through a double slit to make an interfer.docx
 
OS (a) - 5 Points - What is an inode- (b) - 5 Points - How does a soft.docx
OS (a) - 5 Points - What is an inode- (b) - 5 Points - How does a soft.docxOS (a) - 5 Points - What is an inode- (b) - 5 Points - How does a soft.docx
OS (a) - 5 Points - What is an inode- (b) - 5 Points - How does a soft.docx
 
Organizational Structure Evaluate the decision-making process and its.docx
Organizational Structure Evaluate the decision-making process and its.docxOrganizational Structure Evaluate the decision-making process and its.docx
Organizational Structure Evaluate the decision-making process and its.docx
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

The date June 10- is special because when we write in the following fo.docx

  • 1. The date June 10, is special because when we write in the following format, the month times the day equal the year: 6/10/60. Write a program that asks the user to enter a moth, a day, and a two digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic. Solution #include<stdio.h> #include<iostream.h> void main() { int date, year,magic,month; cout<<"Enter month"; cin>>month; cout<<"Enter date"; cin>>date; cout<<"Enter last two digits of year"; cin>>year; magic = month*date; if(magic==year) { cout<<"The date is magic";