Convert an integer(seconds) into the format of an hour: minute: seconds in c input:140153(seconds)
output:38:55:53

I have solved this problem in this way:
#include &lt;stdio.h&gt;
int main(){
    int N;
    double hour;
    double minute;
    double seconds;
    scanf(&quot;%d&quot;,&amp;N);

    hour=N / 3600.0;

    double floating = hour;
    double fractional, integer;

    //split the floating value(hour) into the integer and decimal
    fractional = modf(floating, &amp;integer);
    minute=60 * fractional;

    double floatingUpdate = minute;
    double fractionalUpdate, integerUpdate;
    //split the floating value(minute) into the integer and decimal
    fractionalUpdate = modf(floatingUpdate,&amp;integerUpdate);
    seconds = 60 * fractionalUpdate;
    printf (&quot;%g:%g:%g\n&quot;, integer, integerUpdate, seconds);

    return 0;
}

Would you propose any simplification for my solution? Would I face any problem with some specific conditions? Is the way I solved this kind of problem efficient or not?
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);
}