View Code of Problem 55

#include<stdio.h>
#include<string.h>
int main()
{
  char str[100],c,;
  gets(str);
  scanf("%c",&c);
  for(i=0;str[i]!='\0';i++){
    if(str[i]!=c)
      printf("%c",str[i]);
  }
    
/*
Main.c: In function 'main':
Main.c:5:19: error: expected identifier or '(' before ';' token
   char str[100],c,;
                   ^
Main.c:6:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(str);
   ^
Main.c:8:7: error: 'i' undeclared (first use in this function)
   for(i=0;str[i]!='\0';i++){
       ^
Main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
Main.c:11:3: error: expected declaration or statement at end of input
   }
   ^
*/

Double click to view unformatted code.


Back to problem 55