#include <stdio.h>
#include <string.h>

int main() {
  char foo[50];
  char bar[50];
  printf("What is your name?");
  fgets(foo,sizeof(foo),stdin);
  strncpy(bar, foo, sizeof(bar));
  bar[sizeof(bar) - 1] = '\0';
  printf("Hello, %s\n", bar);
}

