Who's Online

We have 28 guests and 2 members online

Login Form



RSS FEEDS



Decimal to Binary PDF Print
User Rating: / 0
PoorBest 
Program Codes - C Programmig
Written by Mansoorkhan   
Friday, 06 November 2009 03:18

Write a program to convert decimal no to binary?

#include
#include
main()
int i,j,n,a[10];
clrscr();
printf("ENTER THE NO.:");

scanf("%d",&n);
printf("BINARY CODE IS ");
for(i=0;n!=0;i++)
{
a[i]=n%2;
n=n/2;
}
i--;
for(j=i;j>=0;j--)
printf("%d",a[j]);
getch();
}

AddThis Social Bookmark Button
 

Copyright Disclaimer: This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.Thanks to Getkerala

For Latest Technology News and computer tips and tricks