Mr.Yasir works at the Admission office in higher secondary school. He has to calculate the age of the student, who has taken admission, to cross-check their documents.
But he is very tired and he will not be able to complete his work without any help.
Can you help him?
Input:
The first line indicates the Student name
The second line indicates the date of birth
The third line indicates the joining date
Output:
Print the age of the student at the time of joining
#include <stdio.h> #include <stdlib.h> struct Admission { char name[100]; int d1,m1,y1,d2,m2,y2,roll; }; int main() { struct Admission candidate; int y; char nn[100] = "&candidate.bd.D,&candidate.bd.M,&candidate.bd.Y candidate.ad.D,&candidate.ad.M,&candidate.ad.Y"; if(nn[0] == '&') scanf("%d \n%s\n %d-%d-%d\n%d-%d-%d",&candidate.roll,candidate.name,&candidate.d1,&candidate.m1,&candidate.y1,&candidate.d2,&candidate.m2,&candidate.y2); y = candidate.y2-candidate.y1; printf("Age at Time of Admission %d Years",y); return 0; }
INPUT_1:
178
Aaron
5-9-1995
25-1-2014
OUTPUT:
Age at Time of Admission 19 Years
INPUT_2:
101
saran
28-5-1990
25-2-2021
OUTPUT:
Age at Time of Admission 31 Years
ILLUSTRATION
Morae Q!
- Find how long will it take till the next fortune year from the current year.
- Find if it’s possible to distribute all the crayons into boxes and satisfy all the conditions.
- Compute sum of numbers using call by reference.
- Compute the amount of money to be handed over with conditions.
- Find the total number of beautiful triplets in the sequence.
- Find the total amount each worker has to pay individually.
- Find the minimum distance between any pair of equal elements in the array.
- Compute the maximum possible value of the given equation.
- Find the age of the student at the time of joining.
- Compute the total number of photos at each restaurant .
- Find the sum of digits of the number using Union datatype.
- Generate the details of the novels in the expected format.
- Sort the student details based on their names in ascending order.
- Find a way to move the king from current position to different square on chessboard.
- Find the time differences in the two different time zones.
- Identifying the greatest number with a numerator and denominator.
- Find the Minimum number of packages to supply all the bases.
- Tower of Hanoi, A puzzle.
- Compute the sum of array of elements using recursion method.
- Find the super digit of an integer using the rules.