Program to print binary equivalent of a given decimal integer

Below is the program in C Language that will take decimal number as input. It will then call a function that will calculate the binary equivalent of the input decimal number.

You may also like...

7 Responses

  1. Anonymous says:

    Superb!!!

  2. Anonymous says:

    #include
    int main()
    {
    int n,i,m,j,rem[100],bin[100];
    printf(“\n Enter the number to be converted : “);
    scanf(“%d”,&n);
    i=0;
    m=n;
    while(n!=0)
    {
    rem[i]=n%2;
    n=n/2;
    i++;
    }
    for(j=0;j {
    bin[j]=rem[i-1-j];
    }
    printf(“\n Binary Equivalent of %d is : “,m);
    printf(“\n”);
    for(j=0;j printf(“%d”,bin[j]);
    printf(“\n\n”);
    return 0;
    }

  3. Anonymous says:

    gud

  4. Very good solution.plz add more programs

  1. March 2, 2014

    […] Program to print binary equivalent of a given decimal integer […]

Leave a Reply

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