Code:
#include<stdio.h>
int main(){
signed int current, birth, a;
printf("Enter Year of Birth\n");
scanf("%d",&birth);
printf("Enter Current year\n");
scanf("%d",¤t);
if(current<birth)
{
birth=100-birth;
a=birth+current;
printf("Your age is %d",a);
}
else
{
printf("Your age is %d",current-birth);
}
return 0;
}
No comments