View Code of Problem 58

#include <stdio.h>
int main()
{
	int i,n=0;
  	char c[100];
  	gets(c);
  	for(i=0;c[i]!='\0';++i)
        {
        	if(a[i]!=' '&&(a[i+1]==' '||a[i+1]=='\0'))
                  n++;
        }
  	printf("%d",n);
  	





}
/*
Main.c: In function 'main':
Main.c:6:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations]
    gets(c);
    ^
Main.c:9:13: error: 'a' undeclared (first use in this function)
          if(a[i]!=' '&&(a[i+1]==' '||a[i+1]=='\0'))
             ^
Main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 58