Extracredit : Extend q2 above to accept variable length binary integerup to 10 d
ID: 3616540 • Letter: E
Question
Extracredit : Extend q2 above to accept variable length binary integerup to 10 digits.
Sampleinput and output results follow:
Binary Decimal
1 1
11 3
111 7
10101 21
1000000000 512
1111111111 1023
1010101010 682
You do nothave to tabulate your output. Just make sure your program willgenerate the results
as shownin the above table.
Explanation / Answer
please rate - thanks extra credit #include using namespace std; int main() {int i,done; int sum=0,digit,count=0; long int num,temp,div=1,power=1; coutnum; temp=num; while(temp>0&&countRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.