top of page
Wave
Cactus%20Plant_edited.jpg

DECIMAL TO BINARY CONVERSION 

#include<stdio.h>
int main()
{
    int a[100],r,n,i;
    printf("Enter the number: ");
    scanf("%d",&n);
    i=0;
    while(n!=0)
    {
        i++;
        r=n%2;
        a[i]=r;
        n=n/2;
    }
    printf("\nThe binary number is: ");
    while(i!=0)
    {
        printf("%d",a[i]);
        i--;
    }
    return 1;
}

Subscribe Form

Thanks for submitting!

  • Facebook
  • YouTube
  • Instagram
  • Twitter

©2020 by Abhisek Midya ( A18 )

bottom of page