N
newbie@C
Greetings,
I would like to add a date/time function to a program. I would like to be
able to do something like this:
total=age*365+(current date as per users system clock)
See below for the code so far (yes, I am brand spanking new) -
Thanks.
/* Age Converter */
/* age.c */
/* Created on November 8, 2003 */
main()
{
int age,total;
char name[20];
printf("Hello.\n");
printf("\n");
printf("Welcome to my Age Converter!\n");
printf("\n");
printf("What is your name?\n");
scanf("%s",&name);
printf("\n");
printf("O.K. %s, enter your age in years and I'll convert it into
days:",name);
scanf("%d",&age);
total=age*365;
printf("\n");
printf("Your age in days is %d",total);
printf("\n");
}
---
"I wanted to do good without fuss, for I found, that fuss does no good and
that the good makes no fuss."
Louis-Claude de Saint-Martin.
The Unknown Philosopher
I would like to add a date/time function to a program. I would like to be
able to do something like this:
total=age*365+(current date as per users system clock)
See below for the code so far (yes, I am brand spanking new) -
Thanks.
/* Age Converter */
/* age.c */
/* Created on November 8, 2003 */
main()
{
int age,total;
char name[20];
printf("Hello.\n");
printf("\n");
printf("Welcome to my Age Converter!\n");
printf("\n");
printf("What is your name?\n");
scanf("%s",&name);
printf("\n");
printf("O.K. %s, enter your age in years and I'll convert it into
days:",name);
scanf("%d",&age);
total=age*365;
printf("\n");
printf("Your age in days is %d",total);
printf("\n");
}
---
"I wanted to do good without fuss, for I found, that fuss does no good and
that the good makes no fuss."
Louis-Claude de Saint-Martin.
The Unknown Philosopher