Write A Program for counting the number of words in a given string
#include<stdio.h> #include<conio.h> void main ( ) { char a [ 50]; int i ,s=1, l; printf (“enter a string); get...

https://www.computersprofessor.com/2016/06/write-program-for-counting-number-of.html
#include<stdio.h>
#include<conio.h>
void main ( )
{
char a [ 50];
int i ,s=1, l;
printf (“enter a string);
gets ( a);
l = strlen(a);
for ( i = 0, i < l; i ++)
{
if ((a[i] = = ‘ ') && (a[i+1]
! = ' ') || a [i]= = ‘\0’)
s++;
}
printf (“number of words %d”, s);
getch ( );}