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 :a b c d e
I want to make it : abcde
I wrote this code, but it didn't change anything:
Code:#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? Thanks...