Primary expression C++ error -
i have write programs class final , i'm running error can't figure out. have checked syntax in program many times , isn't long don't know why can't find it. when try , compile, error says "expected primary-expression before '}' token". says it's in line 23. can shed light on might going on?
#include <iostream> using namespace std; int main() { int sumofprimes = 2; (int x=3; x<2000000; x++) { (int y=2; y<x; y++) { if (x % y == 0) { goto break1; } } sumofprimes += x; break1: } cout << sumofprimes << endl; return 0; }
you need add statement after label. null statement ; works fine:
break1: ;
Comments
Post a Comment