Computer Science, asked by Gautam25arora, 1 year ago

Write a ‘C’ program in which a scanf() function can read a complete paragraph of text

Answers

Answered by brendonsiva2918
6

Suppose your paragraph contain 100 words

You need to mention the size of the string like given below....

Example;

char a[100];

scanf("%s",a);

printf("%s",a);

INPUT:

This is a sample string words

OUTPUT:

This

EXPLANATION:

String is a collection of words,, end with a null character(\n).In order to overcome the program,,u need to include in scanf as ("%{^\n]s").

Syntax behind the string to write the complete paragraph of text.

Example...

char a[100];

scanf("%{^\n]s",a);

printf("%s",a);

INPUT:

This is a sample string words.

OUTPUT:

This is a sample string words.


THANK YOU

----by sivaraman

Similar questions