Hi,
I want to write a code which takes an array of 20 characters and deletes all spaces between characters, it should leave only letters. For example:
input : d a n i w e b
I want to make it : daniweb
I wrote this code, but it didn't change anything:
#include <stdio.h>
int main ()
{
int i;
char a[21];
gets(a);
for(i = 0; i < 20; i++)
{
if(a[i] == 8 || a[i] == 9)
{a[i]= a[i+1];
i--;}
else continue;
}
printf("%s", a);
printf("\n");
return 0;
}
Can you help me with that? Thank you all...