Given a sentence, , print each word of the sentence in a new line.
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { char *s,tmp; int len,i; s = malloc(1024 * sizeof(char)); scanf("%[^\n]", s); s = realloc(s, strlen(s) + 1); //Write your logic to print the tokens of the sentence here. len=strlen(s); for(i=0;i<len;i++){ tmp=s[i]; if(tmp==' '){ printf("\n"); continue; } printf("%c",s[i]); } return 0; }