Count numbers which are divisible by all the numbers from 2 to 10 | C ++ implementation of the approach ; Function to return the count of numbers from 1 to n which are divisible by all the numbers from 2 to 10 ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countNumbers ( int n ) { return ( n / 2520 ) ; } int main ( ) { int n = 3000 ; cout << countNumbers ( n ) ; return 0 ; }