Line 11: Statement has no effect [-Wunused-value]

Write your question here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  #include "P:\C++\Exercitii si Drills\Drills\pg . 75\std_lib_facilities.h"

using namespace std;

int main()
{
    vector <int> primes;

    int numar = 0;

    int i = 2;

    for(numar<=100; ++numar;){

       while(i<numar){

          if(numar%i!=0){

            primes.push_back(numar);
          }
          i=i+1;
       }

    }
    int cacao = primes.size();

    for(int j=0; j<cacao;){

        cout << primes[j];

        ++j;
    }

}
Last edited on
line 13: on for loop,

1
2
3
4
5
6
7
8
9

for( numar = 0 ; numar <= 100 ; ++numar )
{
    // code
}

[code]

line 29:       cout << primes[ j ] << '\n' ;
Last edited on
Topic archived. No new replies allowed.