The correct answer is (d).
Under Section 235 of the Code of Criminal Procedure, 1973, the accused has a right to be heard on sentence in all trials, whether by a Magistrate or by a Court of Session. However, this right can be waived by the accused. If the accused does not waive this right, the Court must hear the accused before passing sentence.
In a warrant case, the accused is produced before the Magistrate on a warrant issued by the Magistrate. The Magistrate then takes the plea of the accused and proceeds with the trial. If the accused is found guilty, the Magistrate passes sentence. The accused has a right to be heard on sentence in a warrant case.
In a summons case, the accused is summoned to appear before the Magistrate. The Magistrate then takes the plea of the accused and proceeds with the trial. If the accused is found guilty, the Magistrate passes sentence. The accused has a right to be heard on sentence in a summons case.
In a session trial, the accused is tried by a Court of Session. The Court of Session takes the plea of the accused and proceeds with the trial. If the accused is found guilty, the Court of Session passes sentence. The accused has a right to be heard on sentence in a session trial.
Therefore, the accused has a right to be heard on sentence in all trials, whether by a Magistrate or by a Court of Session. This right can be waived by the accused. If the accused does not waive this right, the Court must hear the accused before passing sentence.