Question: answer in c++ a. Write a function that convert a decimal number to its binary representation using stack. You can go through the following algorithm:

answer in c++
a. Write a function that convert a decimal number to its binary representation using stack. You can go through the following algorithm: Step 1: Take a number in decimal Step 2: while the number is greater than 0: Step 2.1: Push the remainder after dividing the number by 2 into stack. Step 2.2: set the number as number / 2. . Step 3: Pop elements from stack and print the binary number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
