scanf in C

To input a string we use scanf function.
#include <stdio.h>
 
main()
{
    char array[100];
 
    printf("Enter a string\n");
    scanf("%s", array);
 
    printf("You entered the string %s\n",array);
    return 0;
}