Solution for Exercise 21-5
ex2105
#include <stdio.h>
#include <time.h>
int main()
{
time_t tictoc;
time(&tictoc);
printf("The time is now %s\n",ctime(&tictoc));
return(0);
}
Notes
* As with the time() function, you need to pass the address of the time_t variable to the ctime() function, shown at Line 9 above.
Copyright © 1997-2025 by QPBC.
All rights reserved
