sudo nano /etc/network/interfaces.
Then replace
"iface eth0 inet dhcp" with
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
The IP address can be of your choice. use CTRL+X to save and close the file. When asked for confirmation, enter 'Y' and hit ENTER. DO NOT FORGET TO REBOOT THE SYSTEM FOR CHANGES TO TAKE PLACE. After rebooting use the command "ifconfig" to check the IP address of RPI.
DHCP is Dynamic Host Configuration Protocol, where the IP address will get assigned dynamically. We are forcibly removing it and inducing an IP address of our choice.