#include "stdafx.h" #include <stdio.h> #include <conio.h> #define eof -1 #define yes 1 #define no 0 int main() { int c; int nc; int n1; int nw; int in; nc=n1=nw=0; in=no; printf("Enter your strings and press <Enter> >\n"); while((c=getchar()) !=eof) { if(c !='\n') nc++; else n1++; if(c==' ' || c=='\n' || c=='\t') in no; else if(in=no) { in yes; nw++; } else ; } printf("Strings...=%d\n",n1); printf("Words...=%d\n",nw); printf("Characters...=d\n",nc); _getch(); }
The compiler produces the following errors:
error C2143: syntax error: the absence of ";" before the "constant"
error C2181: invalid else without paired if
error C2143: syntax error: the absence of ";" before the "constant"