#include <stdio.h> int main() { char str[100],a; gets(str); c=getchar(); for(int i=0;str[i]!='\0';i++) { if(str[i]!=c) printf("%c",str[i]); } return 0; } /* Main.c: In function 'main': Main.c:5:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(str); ^ Main.c:6:4: error: 'c' undeclared (first use in this function) c=getchar(); ^ Main.c:6:4: note: each undeclared identifier is reported only once for each function it appears in Main.c:4:16: warning: unused variable 'a' [-Wunused-variable] char str[100],a; ^ */ |
Double click to view unformatted code.