When they're depicted on television, prosecutors and other lawyers are often aggressive and seem to make statements to, rather than ask questions of, witnesses. Is this how it goes in a real courtroom?
On direct examination, lawyers generally can't ask leading questions. A question is leading if it suggests the answer. For example, "You couldn't see very well, could you?" or, "Did you get to the scene at 8 p.m.?"
The prohibition against leading questions on direct examination forces lawyers to ask non-suggestive questions instead. So, a prosecutor can't guide the testimony of a prosecution witness too much. The prosecutor has likely spoken to the witness before testimony begins and prepared him or her at least somewhat. But, while in court, the prosecution has to let its witnesses give their own accounts. That's why some defense lawyers joke that the most important question for a prosecutor is, "Then what happened?"
On cross examination, however, there are only limited restrictions on questioning. For example, lawyers can't "ask" argumentative questions. These are questions that don't seek information, but rather challenge the witness in order to persuade the fact-finder (the judge or jury). An example of an argumentative question is, "You don't expect the jury to believe that, do you?"
Nor are lawyers allowed to scream, curse, or ask about inadmissible evidence. But, as long as they follow the rules of evidence, attorneys don't have to be cordial with opposing witnesses.
Lawyers might want to restrain themselves somewhat when cross-examining witnesses for fear of coming across as a bully, but they sometimes determine that being aggressive is the best course of action. They might hope that their confrontational style will fluster the witness or expose a nasty character trait. For example, a prosecutor cross-examining a defendant might take a harsh tone with the goal of creating an inconsistency in testimony or exposing the defendant's temper.