Solution for Exercise 21-1

ex2101

#include <stdio.h>
#include <time.h>

int main()
{
    time_t tictoc;

    time(&tictoc);
    printf("The time is now %lu\n",tictoc);
    return(0);
}

Output

The time is now 1589835271

Notes

* The value output is valid for when the program runs.

* Because the time_t value is measured in seconds, it's possible to run the program twice quickly to see the same value output. Otherwise, the value output is different as time marches on.