For this Question: Given a number n find the number of prime numbers less than equal to that number.There is only one integer containing value of n.

Constraints:-
1 <= n <= 10000000Return number of primes less than or equal to nSample Input
5

Sample Output
3

Explanation:-
2 3 and 5 are the required primes.

Sample Input
5000

Sample Output
669, I have written this Solution Code: #include <bits/stdc++.h>
// #define ll long long
using namespace std;
#define ma 10000001
bool a[ma];

int main()
{
int n;
cin>>n;
for(int i=0;i<=n;i++){
    a[i]=false;
}
for(int i=2;i<=n;i++){
    if(a[i]==false){
        for(int j=i+i;j<=n;j+=i){
            a[j]=true;
        }
    }
}
int cnt=0;
for(int i=2;i<=n;i++){
    if(a[i]==false){cnt++;}
}
cout<<cnt;
    return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?