Tuesday, August 14, 2012

How to Write a Program Which give result of your Current Age, Total Months, Total Weeks, All Seconds etc.


#include<stdio.h>
#include<conio.h>
void main()
{
long int bd,cy,age,month,week,days,hour,minute,second;
cy=2012;
clrscr();
                      printf(“\n\n\n\t\t\t\tEnter Your Birth Year “);
                      scanf(“%ld”,&bd);
                      age=cy-bd;
                      month=age*12;
                      week=month*4;
                      days=month*30;
                      hour=24*days;
                      minute=60*hour;
                     second=minute*60;
                     printf(“\n\t Your Age is %ld\n\t Your All Months %ld\n\t Youe All Weeks are %ld”,age,month,week);
                     printf(“\n\t Your All Days are %ld \n\t Your Total Hourse %ld”,days,hour);
                     printf(“\n\t Your Minutes are %ld \n\t Your All Seconds %ld”,minute,second);
getch();
}

No comments:

Post a Comment