C Programming Code Examples C > Miscellaneous Code Examples C Program to Extract Last two Digits of a given Year C Program to Extract Last two Digits of a given Year This program takes any year as input and prints its last two digits. - Take any year as input. - Divide the input by 100 and obtain its remainder. - The remainder got is the output. #include <stdio.h> int main() { int year, yr; printf("Enter the year "); scanf("%d", &year); yr = year % 100; printf("Last two digits of year is: %02d", yr); return 0; }