EmbLogic's Blog

Decimal to binary conversion

1 #include <stdio.h>
2 int main()
3 {
4         int i,a,b;
5         printf(“enter a decimal number\n”);
6         scanf(“%d”, &a);
7         for(i=0;i<=32;i++)
8         {
9                 b=a%2;
10                 printf(“binary number is %d\n”, b);
11                 a=a/2;
12         }
13         return 0;
14 }
~
~
~
~
~
~
~
~
~
“bin.c” 14L, 194C                                             11,3-17       All

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>