Advertisement

Write a program that will read a positive integer and determine and print its binary equivalent


#include <stdio.h>
#include <conio.h>
 void main()
 {int num,bnrydigit;
   printf("Enter the decimal number:= ");
   scanf("%d",&num);
   for(;num!=0; )
   {bnrydigit=num%2;
    printf("%d",bnrydigit);
    num=num/2;
    }
    getch();
    }


May also visit : http://myitzn.blogspot.com/ for more tech and study materials

No comments:

Post a Comment

Please comment bellow. Share your knowledge