#include <stdio.h> #include <string.h> int main() { char c[100]; gets(c); n=strlen(c); for(int i=0;i<n;++i) { if(c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z') printf("%c",c[i]); } } /* Main.c: In function 'main': Main.c:6:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(c); ^ Main.c:7:4: error: 'n' undeclared (first use in this function) n=strlen(c); ^ Main.c:7:4: note: each undeclared identifier is reported only once for each function it appears in Main.c:10:23: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z') ^ */ |
Double click to view unformatted code.