Read string from keyboard : scanf String Read « printf scanf « C Tutorial






#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;
}
What is your name?Tom
     Darn glad to meet you, Tom!








4.26.scanf String Read
4.26.1.Read string from keyboard