Get Input String From Keyboard

Saturday, October 3, 2009

Now, we'll show how to get input string from keyboard using C. This is the example:

/* Example using gets() and scanf() to input string.

int main(void){
    char name[15];

    printf("Insert Your name please: ");
    // or scanf("%s", name);

    printf("Halo, %s. Happy enjoying C. \n", name);

And this is the result:


Post a Comment

Copyright © Welcome