Welcome to W3Courses
 Like Us on Facebook

Base 2

Source Code to Change any Number in Base 10 to Base 2 or Binary in C Programming

Following source code will change any number in base 10 to base 2 or binary in C Programming.

void printit(int num)
 if (num)
  int rem = num%2;
 int num;
 printf("Enter a number: ");
 scanf("%d", &num);
 printf(" base 2\n");