Date Structure

Medium Structures
Solve in Playground →

Problem Statement

Write a C++ program defining a `Date` structure, calculating the number of days elapsed from the start of the year (non-leap year).

Input Format

Day (int), Month (int), Year (int).

Output Format

Print total days elapsed in that year.

Constraints

Valid calendar dates

Sample Input

1 3 2023

Sample Output

60

Explanation

Calculates day of the year (January has 31 days, February has 28 days in non-leap years).

Starter Code

#include <iostream>

struct Date {
    int day;
    int month;
    int year;
};

int main() {
    Date d;
    if (std::cin >> d.day >> d.month >> d.year) {
        // Write your code here
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used