Why does code in c# differ from code in c when i write the same algorithm? : Function in C

    unsigned long int ROTL(unsigned long int x, unsigned long int  y)
	    {
		    return ((x) << (y&(32 - 1))) | ((x) >> (32 - (y&(32 - 1))));
	    }

Function in C#

     uint ROTL(uint x, uint y) 
       { 
           return ((x) << (int)(y & (32 - 1))) | ((x) >> (int)(32- (y & (32 - 1)))); 
       }

above functions do the same work and the same result for small numbers,
but when I pass large numbers the result in C# differ from C.

is there any problem in casting or in the function itself. also I'm try to convert using 

    Convert.ToInt32()
