HOW DO I STORE IN EEPROM longer BYTES

How do I write some data in the EEPROM of Arduino which is an "uint_16" datatype say and it's values may range from 0 - 3000 say ?

split the int in two bytes (use /256 and % 256) and store the low and high part in consecutive addresses

I would be better to use >>8 and &255 instead. If you are using a smart compiler it will convert the /256 to >>8 and %256 to &255 but there is a small risk that the compiler will really generate code for /256 and %256.

The compiler will optimize powers of 2 in divide / modulo operators. This has been discussed && analyzed more often on this forum. The AVR tool-chain includes objdump.exe which can produce assembly listings to check.

Yes but what if you are not using gcc it is best to use best coding practices. It is not like typing &255 is any harder than typing %256 so why not do it? The same with >>8 vs /256.

Mr_arduino:
Yes but what if you are not using gcc it is best to use best coding practices. It is not like typing &255 is any harder than typing %256 so why not do it? The same with >>8 vs /256.

In practice most if not all C compilers do know this optimization.
But you have a point, it is not harder to type or to maintain.
Imo such line of code needs a comment like // split integer in separate bytes.

That is not a why comment that is nothing more than duplicate code.
Yes I understand that bitshifts and, and are for more than splitting a variable I still think it is a waste to type that it should be clear by looking at the code what it is doing.
You might as well be doing something like this

int i=5;//i is an integer and it's value is five
i/2;//We now divide i by the natural number two
for(i=0;i<5;++i)//The loop will run five times
    printf("%d\n",i);//print the value of i to stdout and then a newline
i*=4;//Multiply i by four

You see the comments do nothing to help the clarity of my program but now make it harder to change. If I wanted to start i with a value of six I would now also have to update the comment and if I forget to it will cause confusion. Also yes I know the value of i gets overwritten the code is just to show a point.

Just useL lowByte() highByte() http://arduino.cc/en/Reference/LowByte

Thank you guys for the hot discussion on the topic. A lot of things although went above my head. Still I understood the fact about bit shifting and after another consultation http://gauthiier.info/. I settled down for this:

uint_16 input;
uint_8 low;
uint_8 high;
uint_16 output;

low = input & 0xff;
high = input >> 8; // shift the bits by 8 positions to the right

// now you can write low, high to eeprom
// then read *both* from eeprom and do

output = low + (high << 8); // shift the bits by 8 positions to the left

I would use the AVR EEPROM functions. avr-libc: <avr/eeprom.h>: EEPROM handling

#include <avr/eeprom.h>

uint16_t* x_eeptr = (uint16_t*) 42;
eeprom_write_word(x_eeptr, 999);

uint16_t x = eeprom_read_word(x_eeptr);

Cheers!