Topic 2, Data I/O Functions slide 3

15 flashcardsby Clement
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
What are the two types of I/O functions in C?
Formatted and Unformatted functions
2
Which function is used to write output data to a standard output device in C?
printf
3
What is the syntax of the printf function?
Printf("control/format string", variable1,variable2,...,variable n);
4
Which function is used to enter input data from a standard input device in C?
scanf
5
What does the control or format string in scanf contain?
Certain required formatting information
6
What symbol is used in scanf to indicate the type of the corresponding data item?
%
7
What operator is used in scanf to indicate the memory location of a variable?
& (address of) operator
8
How many types of unformatted I/O functions are there in C?
Three types
9
Which function is used to input single characters in C?
getchar()
10
Which function is used to display single characters in C?
putchar()
11
What functions offer alternatives to scanf and printf for string input and output?
gets and puts
12
What is a disadvantage of the gets() function?
It does not perform any bounds checking, leading to buffer overflows
13
What is a disadvantage of the puts() function?
It lacks formatting options and automatically appends a newline
14
How is a string entered using gets()?
char line[60]; gets(line);
15
How is a string displayed using puts()?
puts(line);
Study all 15 cards for free