How to calculate age using C program
C Program for Age Calculation Want to calculate age using a C program, but couldn't make the source code!!! Here I come with the program you need. I have made this one month ago, and thought to post in this blog so that you guys be helped. Below is the C program to calculate age. Please notify me if you encounter any problem or error. //This program is created by Rupam Medhi. //You can find more program in http://computz365.blogspot.in #include<stdio.h> main() { int d1,d2,m1,m2,y1,y2,D,M,Y; printf("Enter your Birthday-date,month,year\n"); scanf("%d%d%d",&d1,&m1,&y1); printf("Enter today's date-date,month,year \n"); scanf("%d%d%d",&d2,&m2,&y2); if(((d1<=d2)&&(m1<=m2))||(d1<=d2)||(m1<=m2))//default and the easy condition { D=d2-d1; M=m2-m1; Y=y2-y1; } if((d1>d2)&&(m1>m2)) { D=30-d
Comments
Post a Comment
Add your comment here...