View Code of Problem 43

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
    char str[1000];
    int len,i,j;
    gets(str);
    len=strlen(str);
    for(i=0;i<len;i++)
    {
        if(toupper(str[i])>'Z'||toupper(str[i])<'A')
        {
            for(j=i;j<len;j++)
                str[j]=str[j+1];
            len--;
            i--;
        }
    }
    printf("%s\n",str);
    return 0;
}

Double click to view unformatted code.


Back to problem 43