L 30 : Practice Programs in C | Find Current Age, Year, Month & Day | CWC
Carrier with code
0:00 / 0:00
L 30 : Practice Programs in C | Find Current Age, Year, Month & Day | CWC
288 просмотров · Трансляция закончилась 10 дн. назад
Carrier with code
2,34 тыс. подписчиков
288 просмотров · Трансляция закончилась 10 дн. назад
Hello everyone 👋
Welcome to Carrier With Code (CWC)
In this lecture, we will practice some useful C Programming programs based on dates and age calculation.
In this video, we will learn:
How to find current age
How to find birth year
How to find age in years, months and days
How to calculate the difference between dates
Practical examples using C programming
🔹 1. Find Current Age Program in C
📌 Example
Suppose:
Birth Year = 2005
Current Year = 2026
Then:
Age = 2026 - 2005
Age = 21 years
🔹 2. Find Birth Year from Current Age
📌 Example
If:
Current Year = 2026
Age = 21
Then:
Birth Year = 2026 - 21
Birth Year = 2005
🔹 3. Find Age in Years, Months and Days
For a basic practical program, we can calculate the difference between a birth date and a current date.
Example
Birth Date = 10/05/2005
Current Date = 08/10/2026
The program can calculate the difference in years, months and days.
📌 Important Note
This is a basic practice program. It uses 30 days for the borrowing calculation, so it is not a fully calendar-accurate age calculator for every month and leap year.
🔹 4. Find Year, Month and Day Difference
📌 Basic Logic
First calculate:
Year Difference
Month Difference
Day Difference
If the day difference becomes negative, borrow one month.
If the month difference becomes negative, borrow one year.
This helps you understand conditions, variables and date-based calculations in C.
🌍 Real-Life Example
An age calculator follows the same basic idea:
Date of Birth
↓
Current Date
↓
Calculate Difference
↓
Years + Months + Days
This type of logic is useful in:
Age calculators
Registration systems
Student records
Employee records
Date-based applications
⚡ Quick Revision Table
Program Main Logic
Current Age Current Year − Birth Year
Birth Year Current Year − Age
Year Difference Current Year − Birth Year
Month Difference Current Month − Birth Month
Day Difference Current Day − Birth Day
🎯 After This Lecture You Will Be Able To
Calculate current age using C.
Find birth year from age.
Work with day, month and year.
Use conditions for date calculations.
Practice real-life calculation programs.
Understand basic date-based programming logic.
👨💻 This Lecture Is Perfect For
C Programming Beginners
BCA Students
C Programming Practical Exams
College Assignments
Function & Logic Practice
Beginners Learning if-else
Programming Practice
🔍 SEO Keywords
current age program in c
age calculator program in c
find age in c
birth year program in c
year month day program in c
age calculation in c
date calculation in c
c programming practical
c programming practice programs
c programs for beginners
bca c programming
#️⃣ Hashtags
#CProgramming
#CarrierWithCode
#CWC
#AgeCalculator
#AgeProgram
#CProgrammingForBeginners
#CPrograms
#ProgrammingPractice
#BCA
#Coding
#carrierwithcode