i have used "sudo nano /etc/dhcpcd.conf" and added static address, after reboot the raspberry pi shows static address in ifconfig and i can also access it using putty, but it is not able to connect to the internet. i have checked the router and this device does not show up. I am sure there is nothing wrong with the router or cable as i was able to access internet before setting the static ip address.
lines i have typed..
"interfaces eth0 static ip_address=192.168.1.150 static routers=192.168.1.1 static domain_name_servers=192.168.1.1"