What defines a reptile?

If it has feathers it is a bird. If it has hair it is a mammal. What defines a reptile. I hear TV shows saying Alligators are more similar to birds then turtles. Right?