MATLAB: How to display all decimal numbers for floating numbers

decimalfloating point numbersMATLAB

The task I have to perform is take 2 user input numbers that must be floating numbers and add them together. However, when I do this, it cuts off at 4 decimal places. How do I make it so that it displays all decimal numbers? Do I have to use something with %f? I cannot use the "format" command. I am relatively new to MATLab, so any help would be appreciated! Below is what I have so far.

Best Answer

Try this
fprintf('num1+num2 = %1.16g\n',adding_num1_and_num2)