Converting time in number of minutes past midnight to HH:MM format
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 &lt;stdio.h&gt;

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

    for (int i = 1; i &lt;= T; i++) {

        int N;
        scanf("%d", &amp;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.