What is wrong in the code?
There is a problem with your keyboard: it randomly writes symbols when you are typing a text. You need to clean up the text by removing all symbols. Task: Take a text that includes some random symbols and translate it into a text that has none of them. The resulting text should only include letters and numbers. Input Format: A string with random symbols. Output Format: A string of the text with all the symbols removed. Sample Input: #l$e%ts go @an#d@@ g***et #l#unch$$ Sample Output: lets go and get lunch My code #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> int main() { char str[50]; int i=0,f=0; fgets(str,50,stdin); while(str[i]!='\0') { if(isalpha(str[i])||isspace(str[i])) { printf("%c",str[i]); } i++; } return 0; } One of the test case fails