Before you start any exercise, you should warm up nicely by stretching or just walking around for a while. If you start exercising without warming up you will risk a muscle injury.
Sit on the exercise mat
If you have an exercise mat, take it out and sit straight with your feet flat on the ground and knees bent. You must keep your back straight. Make the right leg rest on the floor by straightening it, while placing your hands on the left knee, which should still be bent.
Lift your legs
Raise your right leg off the floor, while keeping your back straight. If you are not able to keep the right leg completely straight, you may bend that slightly. Try to hold the leg up for about three to five seconds. It is going to put a lot of pressure on your right quadriceps. Try to repeat this exercise for about 7 to 8 times in a go. Now you need to repeat the same process with your left leg.
If you just had a knee surgery, it would not be wise for you to do complete sit ups. However, you may just sit down in the air about half-way or even less and stand up. Do not put too much pressure on your thighs and calves and just do 5 repetitions in one set. You can always improve the number of repetitions with the passage of time.
Once you feel that your muscles are stronger and you will not be risking injuries, start cycling regularly. Apart from firming up your thighs and hamstrings, cycling will strengthen your calves as well.