'C program in Git Bash does not accept input properly

I am trying to run my C program in Git Bash but it doesn't seem to accept inputs as expected and as it does in Windows Command Prompt.

This is my simple program:

#include <stdio.h>

int main() {
    char nom[10];
    printf("Enter you name: ");
    gets(nom);
    printf("Your name is %s.", nom);
    return 0;
}

This is a screenshot from Git Bash:

screenshot

This is a screenshot form CMD:

screenshot



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source