3

Multiply 2 Numbers of Different Base & represent Product in another Given Ba...

 2 years ago
source link: https://www.geeksforgeeks.org/videos/multiply-2-numbers-of-different-base-represent-product-in-another-given-base-cpp-program/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Multiply 2 Numbers of Different Base & represent Product in another Given Base

Multiply 2 Numbers of Different Base & represent Product in another Given Base | CPP Program
  • 30 Views
  • 13/07/2022
<p>Here in this video, we will see, a <strong>C++ program to multiply 2 numbers of different bases and represent the product in another given base</strong>. <br><br>For that, we take a string of characters representing a positive integer in one base and return a string representing that same number in the other base. <br><br>Let’s say - 12 and 16, and calculate the product on different bases. <br>First, we convert input numbers into their equivalent numbers in given base 10 (decimal system), i.e. - 12 = 1, 16 = 10.<br>Now, we multiply these numbers in a given base 10 and display the result in different base 10. <br><br>In this example, we take base 10 as input and produce output in base 2. <br>To convert from any base to decimal, find the sum of all the digits of [digit*(base power)] (where powers are from 0 to [NumOfDigits-1]) in the order in which the digits are ordered. <br><br>Converting between decimals and hexadecimal involves understanding decimal system place values as well as binary systems. The hexadecimal number system (hex) functions almost exactly like both decimal and binary systems. <br>The representations help computers compress larger binary values into a form that is easy to convert between the two systems. Non-integers may be represented using negative powers, which are separated from the rest of the digits using the radix point (called a decimal point in binary systems). <br><br>Each hexadecimal number represents 4 binary digits, called nibbles, making representations of large binary numbers simpler. <br><br>Time Complexity: O(D) where D is the maximum number of digits in N, M, and product.<br>Auxiliary Space: O(1)<br><br>Multiple two numbers of different base & represent product in another given base:<br><a href="https://www.geeksforgeeks.org/multiply-two-numbers-of-different-base-and-represent-product-in-another-given-base/">https://www.geeksforgeeks.org/multiply-two-numbers-of-different-base-and-represent-product-in-another-given-base/</a></p>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK