View Code of Problem 43

#include<stdio.h>
int main(){
  char c[90];
  gets(c);
  int i,j=0;
  for(i=0;a[i];i++){
    if(c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z'){
          c[j]=c[i];
    	  j++;
    }
  }
  puts(c);
  return 0;
}
/*
Main.c: In function 'main':
Main.c:4:3: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
   gets(c);
   ^
Main.c:6:11: error: 'a' undeclared (first use in this function)
   for(i=0;a[i];i++){
           ^
Main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
Main.c:7:17: 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.


Back to problem 43