Outputting wrong values(Gyro - L3G4200D)

Well your code still looks reasonable, so it is a mystery.

I would go back to the datasheet and read through the instructions very carefully about how you are
doing the initialization.

I'd look for anyone else's code for this device and see how they are doing the initialization.

I'd print the contents of that 6-byte buffer to see exactly what is in it ( although the code where
you put it into gx, gy, gz looks ok ).

I'd check the scope of all of the variables you are using in your program, carefully.

Maybe you just have a dud device.