Input And Output Flashcards

1
Q
var1 = input('Enter a number: ')
var2 = input('Enter a word: ', 's')
A

Displays the prompt and stores user input in var. ‘s’ must be used if input is a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

disp(‘input’)

A

Displays input without formatting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

fprintf(‘string with placeholder’, input)

A
Formats a string with custom input. Placeholders include:
%s for strings
%c for single character
%d for decimal integer
%f for floating digit number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly