#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"

Closed due to the fact that the participants are not on topic : , Abyx , Vladimir Glinskikh , aleksandr barakin , Visman 27 Sep '15 at 3:02 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - YuriyPb, Abyx, Vladimir Glinskikh, aleksandr barakin, Visman
If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

     in no in yes 

    no assignment

     in=no in=yes 

      And further

       else if(in=no) { in yes; nw++; } 

      Will always enter if if no is non-zero.

      • A normal compiler gives such warnings. - alexlz
      • well xs, gcc without -Wall silently compiled - AlexDenisov
      • Alas, yes. Conclusion - do not forget -Wall. gcc at the same time and about the third printf warning issued (there in the format instead of %d worth d ) - alexlz