C Programme to convert decimal to binary
#include<conio.h>
#include<stdio.h>
int main()
{
int binary[10],no,i=0,j,a,r;
printf("\nEnter decimal number");
scanf("%d",&no);
a=no;
while(a!=0)
{
binary[i]=a%2;
i++;
a=a/2;
}
for(j=i-1;j>=0;j--)
printf("%d",binary[j]);
}
0 comments:
Post a Comment