#include <iostream>
      #include <cmath>
      
      using namespace std;
      long long convert(int);
      long long convert(int n) {
        long long bin = 0;
        int rem, i = 1;
        while (n!=0) {
          rem = n % 2;
          n /= 2;
          bin += rem * i;
          i *= 10;
        }
        return bin;
      }
      

      Cpp language logoDecimal to Binary

      Codiga's C++ Recipes

      Convert decimal to binary number

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.