<em>#include <stdio.h>
</em>
<em>#include <stdlib.h>
</em>
<em>
</em>
<em>int main ()
</em>
<em>{
</em>
<em> int n, i = 1, k;
</em>
<em> int j;
</em>
<em> binary int [10];
</em>
<em> printf ("Enter Number \ t:");
</em>
<em> scanf ("% d", & n);
</em>
<em> while (n> 0) {
</em>
<em> binary [i] = n% 2;
</em>
<em> n = n / 2;
</em>
<em> i = i + 1;
</em>
<em> k = i;
</em>
<em>
</em>
<em> }
</em>
<em> for (j = k-1; j> 0; j--)
</em>
<em> {
</em>
<em> printf ("% d", binary [j]);
</em>
<em> }
</em>
<em>
</em>
<em>}
</em>
<h2>Further explanation</h2>
Basically, what is meant by number conversion is the process of changing the form of one number to another number that still has the same value. Converting decimal numbers to binary numbers means changing the form of decimal numbers to form binary numbers that still have the same value.
The method of converting decimal numbers to binary numbers is quite easy, by dividing decimal numbers into a base of binary numbers that is 2, the results are then rounded down and the remainder of the division results are stored or recorded. Make rounding down until the value reaches zero. The remaining shares are then sorted from the last to the earliest. The rest of the sorted order is the result of the conversion of decimal numbers to binary numbers.
Example of Converting Decimal Numbers to Binary Numbers
Convert a decimal number value 50 to a binary number:
50/2 = 25 the remainder is 0
25/2 = 12 remainder is 1
12/2 = 6 the remainder is 0
6/2 = 3 remainder is 0
3/2 = 1 remainder is 1
1/2 = 0 the remainder is 1
Learn More
Simple modulo calculation program brainly.com/question/13572257
C ++ programming language brainly.com/question/13572257
Details
Class: College
Subject: Computers and Technology
Keywords: program, modulo, c++