#include #include int main() { char s[100], w[50][100], tmp[100]; char ss[100], ssw[50][100]; char sw[100], lw[100]; int spaces = 0; int ssspaces = 0; int i, j, k; int flag = 1; // Sentences should end with a '.' // No other special characters allowed printf("Enter the string:\n"); scanf(" %[^\n]s", s); s[0] += 32; j = 0; k = 0; for(i=0; istrlen(w[j])) strcpy(sw, w[j]); } j += 1; k = 0; } else { w[j][k] = s[i]; k += 1; } } for(i=0; i<(spaces-1); i++) { for(j=(i+1); j0) { strcpy(tmp, w[i]); strcpy(w[i], w[j]); strcpy(w[j], tmp); } } } printf("Shortest word: %s\n", sw); printf("Longest word: %s\n", lw); printf("First word: %s\n", w[0]); printf("Last word: %s\n", w[spaces-1]); // Sentences should end with a '.' // No other special characters allowed printf("\nEnter the second string:\n"); scanf(" %[^\n]s", ss); ss[0] += 32; j = 0; k = 0; for(i=0; i0) { strcpy(tmp, ssw[i]); strcpy(ssw[i], ssw[j]); strcpy(ssw[j], tmp); } } } for(i=0; i