In this program user ask to convert decimal number into binary number. Binary number has the base of 2. In this program user declare the variable and then the while condition in while condition (n>0). That will manipulated with a[d]=n%2. And then division with 2. Here after the increment operator and for printing out the binary number user uses the loop statement that will generate the binary number on the display.
This is c program that asks the user to convert Decimal number into Binary.
- Declaring the variable.
- Using while condition.
- Divide the number with required quotations.
- Using loop statement.
- Display result on the screen.
Here is C source code for calculating the gross salary of employees. The output of this program shown below.
printf("Enter the Integer which u want to Convert Decimal to Binary : ");
printf("After Converting Decimal to Binary is : ");