Doing exercise will make your knee flexible ... But one more reason can be a baker cyst because of which you feel pain and swelling in the knee and difficulty sitting and walking.