I must to write i program in C which will carry into clause(sentence) from keyboard and count how much "," have how much spaces " " have and how much times occur the word "The" for every clause(sentence). And in the end program when you carry into clause(sentence) must print all inputs particular for every clause how and the same clauses also? I must use array.
EX:
the problem is, my and, is big
In this sentence you have 6 spaces 2 full stops and word "The" is occure 1
I write some code but is not full i need someone to help me to finish the code on this program
#include<stdio.h>
#include<string.h>
#define MAX 100
int main()
{
char sentence[100];
int spaces=0,full_stop=0;
puts("Enter sentence");
gets(sentence);
for(i=0;sentence[i]!='\0';i++)
{
if (sentence[i]==',')
full_stop+=1;
if (sentence[i]==' ')
spaces+=1;
}
printf(" %d %d %d %d pati\n",full_stop,spaces);
return 0;
}