/* Example:input string in C language */ #include <stdio.h> #include <stdlib.h> #include<conio.h> int main() { char username[10]; printf("input the name:"); gets(username); // or // scanf("%[^\n]s", &username); printf("STRING :%s",username); return 0; }
output example:
input the name:lautturi STRING :lautturi