Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago