C Tutorial/printf scanf/scanf String Read
Read string from keyboard
<source lang="cpp">#include <stdio.h>
- include <string.h>
int main(void) {
char word1[20]; printf("\nType in the first word:\n 1: "); scanf("%19s", word1); printf("%19s",word1); return 0;
}</source>
What is your name?Tom Darn glad to meet you, Tom!