These are some programs i am providing to you, You can ask me your problems related to programs here.... Please send me your feedback. For other language programs please visit techprograms.blogspot.com. Thank you
Write a ‘C’ program to convert given decimal number into binary number
#include
#include
void main()
{
int n,j,a[50],i=0;
clrscr();
printf("\n enter the value :-");
scanf("%d",&n);
while(n!=0)
{
a[i]=n%2;
i++;
n=n/2;
}
printf("\n binary conversion\n");
for(j=i-1;j>=0;j--)
printf("%d",a[j]);
getch();
}
No comments:
Post a Comment