Convert an integer(seconds) into the format of an hour: minute: seconds in c
When we write

scanf(&quot;%d&quot;,&amp;N);


it's important not to ignore the return value from scanf() (that indicates how many values were successfully converted).  Otherwise, we're working with the uninitialised value N.

Use of the modf() function requires a declaration:
#include &lt;math.h&gt;

But we would be better working with integers instead (use the / and % operators).

Presentation of negative values is strange:

-70:-29:-29

Normally, we'd just print that as -70:29:29.
I'd be inclined to just work with unsigned values, and get that working well, before extending to negatives.

Variable naming is inconsistent (singular hour and minute, but plural seconds).  N is a poor choice for a variable name - choose something more meaningful and lower-case; convention reserves upper-case for macros.

We should make the declaration of main() be a prototype.  Also, it's permitted to omit the return statement in main(); since we always return success, let's remove that clutter.

Modified code
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main(void)
{
    unsigned long total_secs;
    while (scanf(&quot;%lu&quot;, &amp;total_secs) != 1) {
        // consume some input
        if (scanf(&quot;%*s&quot;) == EOF) {
            return EXIT_FAILURE;
        }
        printf(&quot;Enter a valid integer: &quot;);
        fflush(stdout);
    }

    unsigned long hour = total_secs / 3600;
    unsigned int minute = total_secs / 60 % 60;
    unsigned int second = total_secs % 60;

    printf(&quot;%lu:%u:%u\n&quot;, hour, minute, second);
}