Is Cancer Inherited?

The reason I chose cancer as my wonder day project is because my grandpa had lung cancer and then one of my sisters ended up getting brain cancer. And I just wanted to know if I could possibly get it