Posts

Showing posts with the label Factorial!

HackerEarth's basic programming solutions( Count Divisors, Factorial!, Toggle String, Roy and Profile Picture ) :

Problem 7: Count Divisors Solution: (in c++) ( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder) #include < bits/stdc++.h > using namespace std ; int main () {      int l , r , k , count = 0 ;     cin >> l >> r >> k ;      for ( int i = l ; i <= r ; i ++)      {          if ( i % k == 0 )          {             count ++;          }      }                                 cout << count << endl ;         ...