My resize does the work pretty well with the smiley.bmp and small.bmp. Although it fails to pass check50. I've checked my program so many times, the headers are the same as the stuff implementation, so there is no bug. 

<pre>
:) resize.c and bmp.h exist
:) resize.c compiles
:) doesn't resize 1x1-pixel BMP when n is 1
:( resizes 1x1-pixel BMP to 2x2 correctly when n is 2
:( resizes 1x1-pixel BMP to 3x3 correctly when n is 3
:( resizes 1x1-pixel BMP to 4x4 correctly when n is 4
:( resizes 1x1-pixel BMP to 5x5 correctly when n is 5
:( resizes 2x2-pixel BMP to 4x4 correctly when n is 2
</pre>

I know it was asked so many times, but I still couldn't find the right answer. Getting desperate :(

My code: (I've read the headers also in the biOutput and bfOutput, modified the relevant properties for the new file's header)

  // determine padding for scanlines
    int padding =  (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;
 
    // iterate over infile's scanlines
    for (int i = 0, biHeight = abs(biOutput.biHeight); i < biHeight; i++)
    {
         
        // loop for vertical stretching
        for (int n = 0; n < size; n++)
        {
         
            // iterate over pixels in scanline
            for (int j = 0; j < bi.biWidth; j++)
            {
                // temporary storage
                RGBTRIPLE triple;
 
                // read RGB triple from infile
                fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
 
                // write RGB triple to outfile n times
                for (int m = 0; m < size; m++)
                {
                    fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
                }
            }
 
            // skip over padding, if any
            fseek(inptr, padding, SEEK_CUR);
 
            // then add it back (to demonstrate how)
            for (int k = 0; k < paddingOutput; k++)
            {
                fputc(0x00, outptr);
            }
             
            // resetting position for vertical resizing
            fseek(inptr, -(bi.biWidth * sizeof(RGBTRIPLE)  + padding), SEEK_CUR);
        }
        fseek(inptr, bi.biWidth * sizeof(RGBTRIPLE) + padding, SEEK_CUR);
    }