How do you write a c program to convert binary to decimal using stack?

1 answer

Answer

1254329

2026-07-12 22:25

+ Follow

ALGORITHM: function outputInBinary(Integer n) Stack s = new Stack while n > 0 do Integer bit = n modulo 2 s.push(bit) if s is fullthen return error end if n = floor(n / 2) end while while s is not empty dooutput(s.pop()) end while end function

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.