└── printing tokens /printing tokens: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() { 4 | 5 | char *s; 6 | s = malloc(1024 * sizeof(char)); 7 | scanf("%[^\n]", s); 8 | s = realloc(s, strlen(s) + 1); 9 | //Write your logic to print the tokens of the sentence here. 10 | for(int i = 0; s[i] != '\0'; i++) 11 | { 12 | if(s[i] == ' ') 13 | { 14 | s[i] = '\n'; 15 | } 16 | printf("%c",s[i]); 17 | } 18 | return 0; 19 | } 20 | --------------------------------------------------------------------------------