how to take blank space in c scanf

You can use the following code snippet to take blank spaces as input using scanf in C:

#include <stdio.h>

int main() {
    char sentence[100];

    printf("Enter a sentence with spaces: ");
    scanf(" %[^\n]s", sentence);

    printf("You entered: %s\n", sentence);

    return 0;
}