function [c]= pix2rc(im,p)
    //To calculate Row and Column details given image im and pixel number p
    //Example: im = imread('test_1.png');
    //         pix2rc(im,312)
    //Output displayed on console ------- 
    //Row Number = 2, Column no.=56
    //  ans  =     2.    56.  
    //
    //          pix2rc(im,65539)
    //          Pixel value is outside Range
    //ans  =      []
 
    clc;
    c=[];
    mprintf('\n');
    pixel = p;
    [m,n]=size(rgb2gray(im));
    if(pixel>m*n)
            mprintf('Pixel value is outside Range\n')
            return;
        end
    if(pixel<=m*n)
        for i=0:1:(m-1)
              if(pixel>=(n*i+1))
                  if(pixel<=n*(i+1))
                    row=i+1;
                    column = pixel-n*i;
                    mprintf('Row Number = %d, Column no.=%d\n\n',row, column);
                    c = [row column];
                    return;
                  end
              end
        end
    end
    
endfunction
