is there any other way how to use int removetrail(char s[]) without loops FOR and IF
Code:intremovetrail(chars[]){ int i; for(i=0; s[i]!='\n'; ++i) ; --i; /* To consider raw line without \n */ for(i >0; ((s[i] == ' ') || (s[i] =='\t'));--i) ; /* Removing the Trailing Blanks and Tab Spaces */ if( i >= 0) /* Non Empty Line */ { ++i; s[i] = '\n'; ++i; s[i] = '\0'; } return i; }