Answer:
Following are the program to this question:
#include <stdio.h>//using the header file
int main()//main method
{
int y;//defining integer variable y
printf("Enter year value:");//print message
scanf("%d", &y);//use input method for input year value
if (y>= 2101)//defining if block that checks year greater then 2101
printf("Distant future");//print message
else if (y>= 2001)//defining else if block that checks year greater then 2001
printf("21st century"); //print message
else if (y>= 1901)//defining else if block that checks year greater then 1901
printf("20th century");//print message
else //defining else block
printf("Long ago");//print message
return 0;
}
Output:
Enter year value:1998
20th century
Explanation:
In the given C language code, inside the main method, an integer variable "y" is defined, which allows the user to input the year value, and use the multiple conditions to check the given value and print message when the condition is matched.