programming-examples/c/Basic/C Program to Extract Last two Digits of a given Year.c

14 lines
270 B
C
Raw Normal View History

2019-11-18 14:44:36 +01:00
/*
* C Program to Extract Last two Digits of a given Year
*/
#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;
}