answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<stdlib.h>

main()

{

int number,binary[10000],b=0;

printf("Enter decimal number ");

scanf("%d",&number);

printf("\nBinary: ");

for(;number;number/=2,b++)

binary[b]=number%2;

for(b--;b>-1;b--)

printf("%d ",binary[b]);

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C plus plus program that convert decimal to binary using the concept of stack?
Write your answer...
Submit
Still have questions?
magnify glass
imp