"%s" is the default parsing format of a string in scanf(). "%s" does not include blanks or tabs etc. Here we need an end of sentence character like full stop or $ or new line (\n) to tell scanf() that we are at the end of an input. Some compiler also supports "%[...]" to scan blanks and tabs in the string. Let us see an example where user types in a sentence and gives full stop at the end.
int main(int argc, char *argv)
printf("Enter the sentence, end with full stop or dot \n: ");
You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.