Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program should be in C language. Write a program to ask the user to input a date of 2017 and calculate which day it

This program should be in C language. Write a program to ask the user to input a date of 2017 and calculate which day it is in one week. Assume you already know the first day in 2017 is Sunday. And you also know the number of days in each month. (Jan:31, Feb:28, Mar:31, Apr:30, May:31, Jun:30, Jul:31, Aug:31, Sept:30, Oct:31, Nov:30, Dec:31). (TIP: First calculate how many days there are between 01/01/2017 and the day the user input, then mod the number of days by 7, use the result of mod to infer which day in one week it is. You can use switch inside a for loop to calculate the number of days. And use another switch to print out day in a week based on the result of the mod.)

For Example:

Input the month:10

Input the day:22

10/22/2017 is Sunday!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago