Commit a43c6987 by ilahma

Upload New File

parent a4d393b7
Showing with 29 additions and 0 deletions
#include <stdio.h>
int main()
{
int n;
int count;
int i;
int binary[100];
printf("Enter decimal number:\n ");
scanf("%d",&n);
count=0;
while(n>0)
{
binary[count]=n%2;
n=n/2;
count++;
}
printf("The answer is \n ");
for(i=(count-1);i>=0;i--)
{
printf("%d",binary[i]);
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment