Saturday, 30 December 2017

C program to read a string with space (Text with space)

#include <stdio.h>

int main (int argc, char const *argv[])
{
    char name[20];
    printf("enter your name \n");
    scanf("%[^\n]s",name);
    printf("%s\n", name);
    return 0;
}



No comments:

Post a Comment