C program to count number of words in a sentence including comma tabs
Answers
Answered by
0
/* * C Program to Count Number of Words in a given Text Or Sentence */#include <stdio.h>#include <string.h> void main(){ char s[200]; int count = 0, i; printf("enter the string\n"); scanf("%[^\n]s", s); for (i = 0;s[i] != '\0';i++) { if (s[i] == ' ') count++; } printf("number of words in given string are: %d\n", count + 1);}
saransh37:
If u like me answer than follow me and you can provide me your WhatsApp no
Similar questions
Geography,
7 months ago
Computer Science,
7 months ago
Science,
7 months ago
Biology,
1 year ago
Science,
1 year ago