If you suspect worms, then please take the cat to a vet and have them determine if or what kind of worms are present. It's not a good idea to just use the over the counter worm medicine. Worm medicine is poison, so a vet should be the one to determine if the cat needs to be treated.
If you have an outside cat, they should be checked at least once or twice a year by the vet. If you have a problem with fleas, then its a good chance the cat will have tapeworms from the fleas.