Q:

Converting time in number of minutes past midnight to HH:MM format

This program is a clock that only displays minutes passed since midnight. This program is supposed to be really simple but because of some "aesthetic bug", I wrote quite a lot if-else statements that I think can be simplified.

Format Input
The first line will contain an integer T, the number of test cases.
  Each test case will contain an number N, the number displayed by the
  strange clock.
Format Output
For each test case, print “Case X: “ (X starts with 1) and then print
  what time it is in 24 hours HH:MM format.
Constraints
1 <= T <= 1000
0 <= N <= 1439

#include <stdio.h>

int main()
{
    int T;
    scanf("%d", &T);

    for (int i = 1; i <= T; i++) {

        int N;
        scanf("%d", &N);

        int hours = N / 60;
        int minutes = N % 60;

        printf("Case #%d: ", i);

        if (N < 10) {
            printf("00:0%d\n", N);
        } else if (N > 10 && N < 60) {
            printf("00:%d\n", N);
        } else if (N > 60 && N < 600) {
            if (minutes == 0) {
                printf("0%d:00\n", hours);
            } else if (minutes > 0 && minutes < 10) {
                printf("0%d:0%d\n", hours, minutes);
            } else {
                printf("0%d:%d\n", hours, minutes);
            }
        } else {
            if (minutes == 0) {
                printf("%d:00\n", hours);
            } else if (minutes > 0 && minutes < 10) {
                printf("%d:0%d\n", hours, minutes);
            } else {
                printf("%d:%d\n", hours, minutes);
            }
        }
    }
}

A:

Following @Martin R's comment, I'll make my comment above a solution:
printf already supports what you're trying to achieve with your if-then-else jungle:
#include <stdio.h>

int main()
{
    int T;
    scanf("%d", &T);

    for (int i = 1; i <= T; i++) {

        int N;
        scanf("%d", &N);

        int hours = N / 60;
        int minutes = N % 60;

        printf("Case #%d: %02d:%02d\n", i, hours, minutes);
    }
}

You're also missing to check the return value of scanf. It is used to report errors in the input. What is the purpose of the first scanf?
Edit
From @chux's comment: you should validate the constraints of N after the input.
Edit
Note: additional variables should indeed have no influence on performance and are a good way to document meaning of your code, so please ignore my initial statement about "saving variables". 
Old version was:

Also, I'd change the variable naming. Use minutes instead of N to
  communicate clearly what you're handling in the variable. You can then
  write the computation directly in the parameter list of printf, saving
  you two additional variables.

A:

If your code is checked by an automated process, you will probably fail all test cases because your code prints a #, which was not asked for. You should better remove it. Just print "Case %d" instead of "Case #%d".

