Computer Science, asked by faithyetty672, 10 months ago

Write a program to input any string and to find the number of words in the string.

Answers

Answered by mersalkeerthi46
1

The program output is also shown below.

* C Program to Count Number of Words in a given Text Or Sentence.

#include <string.h>

{

char s[200];

int count = 0, i;

printf("enter the string\n");

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

for (i = 0;s[i] != '\0';i++)

Similar questions