It could be many, many, many things. You'll have to have the codes read and a proper diagnosis preformed. You can go to Auto Zone and they'll read the codes, but be warned that this probably won't highlight the exact problem. You'll need to be able to investigate further.
As an example, a misfire code could be a faulty/worn plug, plug wire, etc. The tranny might be giving some fits, mine did and it felt all the world like a bad misfire or fuel starvation problem.
Get thee codes read.
1998 C230 "Black Betty"