I would like to print data within a signle input block in a way something like this:

In[153]:= a = 5;
          (*expected output (5) here*)
          b = 3;

Is there any way to achive this effect?

  • 1
    $\begingroup$ You can't. output cells are separate from input cells. All output from an input cell go to a separate cell after the input cell. $\endgroup$
    – Nasser
    Mar 9 at 12:46
  • 4
    $\begingroup$ Welcome to Mathematica StackExchange! Does this answer your question? Cell splitting in mathematica $\endgroup$
    – Domen
    Mar 9 at 14:13
  • $\begingroup$ Welcome to the Mathematica Stack Exchange. The introductory book written by the inventor is a good learning resource. There is a fast intro for math students as well as a fast intro for programmers to choose from. $\endgroup$
    – Syed
    Mar 9 at 15:15