Find number of prime numbers between 2 input numbers

# include <bits/stdc++.h>

using namespace std ;

int main()

{

    int x, y ;

    cout << " enter x, y:" ;

    cin >> x >> y,

    int prim ;

    prim = 0

    for (int i = 1 ; i< y-x ; i++)

    {

        int N = x + i ;

        int count =0 ;

        for (int j=2 ; j <= N-1 ; j++)

        {

            

            if (N % j == 0 ){

               

               count = count + 1;

            

            }

            

        }

        if (count == 0)

        {

            prim = prim +1 ;

        }

        

    }

    cout << prim ;

    return 0;

}

Pls find mistake in my code.

You mean to do ==.

2 Likes

ya, I edited it but now it’s showing

Please check your syntax. Every line needs to end in semicolon

1 Like

No semicolon after prim =0.

thanku, It worked.

for more info