View Code of Problem 43

#include<stdio.h>
#include<string.h>

int main()
int isLetter(char c);
{
	char s[90];
	int len, i;
	scanf("%s", &s)
	len = strlen(s);
	for(i = 1; i < len; i++)
	{
		if(isLetter(s[i]))
		printf("%c", s[i]);
	}
	return 0;
} 
int isLetter(char c)
{
	if(c >= 'A' && c <= 'Z' || c >= 'a' && c <='z')
	return 1;
	else
	return 0;
}
/*
Main.c: In function 'main':
Main.c:5:5: error: declaration for parameter 'isLetter' but no such parameter
 int isLetter(char c);
     ^
Main.c:9:2: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[90]' [-Wformat=]
  scanf("%s", &s)
  ^
Main.c:10:2: error: expected ';' before 'len'
  len = strlen(s);
  ^
Main.c: In function 'isLetter':
Main.c:20:14: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  if(c >= 'A' && c <= 'Z' || c >= 'a' && c <='z')
              ^
*/

Double click to view unformatted code.


Back to problem 43