need help on a simple question.
1 view (last 30 days)
I've only entered as for the input. however, in the output, it shows "The char is s" and "The char is as". Can I know how do i get rid of the "The char is s" statement? Thank you.
%Prompt the user to enter a character followed by number
char = input ('Enter the character:','s');
num = input('Enter the number:');
%Print all variables in sentence format
fprintf ('The char is %4s\n','s',char)
fprintf ('The num is %5.2f\n', num)
Enter the character:as
Enter the number:23
The char is s
The char is as
The num is 23.00