Count Words in String C Program
Count Words in String C Program – Write down a C program to input a string and find the number of words in it. Source Code #include <stdio.h> void main() { char str[100]; int wordcount=1, i=0; printf(“Enter a string to count No. of words :\n”); fgets(str, 100, stdin); while(str[i]!=’\0′) { if(str[i]==’ ‘ || str[i]==’\n’ ||… Read More »