Question:C program to extract last two digits of a given year and print it 

Answer 
#include<stdio.h>
int main(){
  int yyyy,yy;

  printf("Enter a year in for digits: ");
  scanf("%d",&yyyy);

  yy = yyyy % 100;
  printf("Last two digits of year is: %02d",yy);

  return 0;
}
Sample Output: Enter a year in for digits: 1985 Last two digits of year is: 85 

+ Report
Total Preview: 1194
C program to extract last two digits of a given year and print it
Copyright © 2024. Powered by Intellect Software Ltd