Smallest multiple of N with exactly N digits in its Binary number representation | C ++ program to find smallest multiple of n with exactly N digits in Binary number System . ; Function to find smallest multiple of n with exactly n digits in Binary number representation . ; Driver code
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; void smallestNumber ( int N ) { cout << N * ceil ( pow ( 2 , ( N - 1 ) ) / N ) ; } int main ( ) { int N = 3 ; smallestNumber ( N ) ; return 0 ; }