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