Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8628865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:39:42+00:00 2026-06-12T08:39:42+00:00

So the user enters the year + it tells whether or not it is

  • 0

So the user enters the year + it tells whether or not it is a leap year.. but now i need help getting the DAY of the week to pop up when it IS a leap year.

# include <math.h>
# include <stdio.h>

int main (void)
{
    int yearEntered;

    printf("Enter a year: ");

    int read = scanf("%d", &yearEntered);

    if (read == 0 )
    {
        printf("Bad input: requires an integer");
    }
    else if (yearEntered%4==0 && yearEntered%100!=0 || yearEntered%400==0)
    {
        printf("%04d is a leap year and February 29th is on a \n",yearEntered, dayString);

    // Not so sure about this switch statement......
    switch (DayOfWeek)
    {
        case 0:
        {
            dayString("Sunday");
            break;
        }
        case 1:
        {
            dayString("Monday");
            break;
        }
        case 2:
        {
            dayString("Tuesday");
            break;
        }
        case 3:
        {
            dayString("Wednesday");
            break;
        }
        case 4:
        {
            dayString("Thursday");
            break;
        }
        case 5:
        {
            dayString("Friday");
            break;
        }
        case 6:
        {
            dayString("Saturday");
            break;
        }
        default:
        {
            dayString("");
        }

    }

    else if (yearEntered < 1752)
    {
        printf("%04d is not a 4 digit year after 1752.",yearEntered);
    }
    else
    {
        printf("%d is not a leap year.\n",yearEntered);
    }

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:39:43+00:00Added an answer on June 12, 2026 at 8:39 am

    If your problem were only about the day of week for Feb 29th, you’d just have to compute day of week for Feb 28th and increment it (modulo seven of course).

    But I guess that your problem is to find day of week, no matter which particular day.

    In that case, you may be interested in what Wikipedia has to say: Determination of the day of the week.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a user enters a date in text box,i've to check ,whether it is
I want to validate a year in the form (XXXX) after the user enters
If a user enters a URL with a action=editDocument, I want to be able
When a user enters a search query, I'd like to track: 1) Their search
When the user enters info I want all the controls to look and act
When the user enters his/her MerryParentEmail address, the corresponding name should be fetched fr
When a user enters captcha and then clicks download on a file hosting site
If a user enters 5 numbers, lets say... 4, 4, 7, 7, 4 .
I have a string mystring that the user enters. I check that it is
I have a UI where the user enters a number into a text box,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.