Mega Code Archive

 
Categories / C / Code Snippets
 

Narrow the input letter and space

#include <stdio.h> int main(void) { char str[100]; printf("Enter letters and spaces\n"); scanf("%[a-zA-Z ]", str); printf(str); return 0; }