how to use scanf function to capture whitespace in C language

how to use scanf function to capture whitespace in C language
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[]) {

    char name[20];

    printf("Input a name : ");
    scanf("%[^\n]s",name);

    printf("The name is: %s\n", name);

    return 0;

}
Sou‮:ecr‬www.lautturi.com

result:

Input a name : hello lautturi.com
The name is: hello lautturi.com
Created Time:2017-08-29 09:07:29  Author:lautturi