> ## Documentation Index
> Fetch the complete documentation index at: https://learn.acadlink.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Nested Structure

> Use a nested structure to store a student's date of birth.

## Problem Statement

Write a C program that uses a nested structure to store a student's name along with their date of birth (day, month, year).

## Solution

```c theme={null}
#include <stdio.h>

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

struct Student {
    char name[50];
    struct Date dob;
};

int main() {
    struct Student s = {"Alice", {15, 8, 2003}};
    printf("%s was born on %d/%d/%d\n",
        s.name, s.dob.day, s.dob.month, s.dob.year);
    return 0;
}
```

## Output

```
Alice was born on 15/8/2003
```
