Question: USING C LANGUAGE USE stdio.h only DO NOT USE GLOBAL VARIABLES DO NOT USE ARRAYS, STRUCTS OR UNIONS USE LOOP STATEMENTS USE int and float

USING C LANGUAGE

USE stdio.h only DO NOT USE GLOBAL VARIABLES DO NOT USE ARRAYS, STRUCTS OR UNIONS USE LOOP STATEMENTS USE int and float only DO NOT USE break in non-switch statements CREATE A FUNCTION

Create a program that will convert binary to octal

USING C LANGUAGE USE stdio.h only DO NOT USE GLOBAL VARIABLES DO

To convert binary number to octal, 1. Group digits in binary into groups of 3. starting from the rightmost digit. If the binary number is 101010101, the groupings of digits will be 101 010 101. . If the binary number is 11011000, the groupings of digits will be 011 011 000. Is are added to the left of the leftmost of the digit to complete the group. 2. Compute for the octal equivalent of each group. To compute for the octal equivalent for each group of 3, e.g. the group is 011: 011 1 x 20 = 1 1 x 21 = 2 0 x 22 = 0 3. Do the same for all groups of 3. The resulting digits form the octal equivalent. Sample computation. Assume that the binary number is 10110000. 010 110 000 0 x 22=0 1 x 2 = 2 0 x 20 = 0 2 0 x 20 =0 0x 21 = 0 x 22 = 0 0 0 x 2 = 0 x 200 1 x 2 2 x 22 = 4 6 The octal value for each group: binary: 10 110 000 octal: 260 Thus, the equivalent for the binary number 10110000 is 260

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!