1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
saveliy_v [14]
3 years ago
12

Assume you are programming an embedded microcontroller in C and want your code to follow good software engineering practices, be

as portable as possible, and not be wasteful of memory. You need to select a variable that can hold an integer from 0 to 132. What is the best choice for the variable type?
Engineering
2 answers:
Olegator [25]3 years ago
5 0

Answer:

unsigned char

Explanation:

Selecting best data type depends upon the application. Memory and portability are some of the considerations while selecting a data type.

For the given scenario, we need to store an integer in the range of 0 to 132.

Lets have a look at some of the options available for variable data types.

Type: signed char

storage size: 1 byte

Range: -128 to 127

Type: unsigned char

storage size: 1 byte

Range: 0 to 255

Type: int

storage size: 2 byte

Range: -32,768 to 32,767

Unsigned char would be best choice since we need to store only positive integers and it gives us range 0 to 255 which is more than enough for our case and storage size is also least. Other data types are simply too big to consider for this scenario and hence they will be a wasteful of memory.

Please note that the name of data type is "char" but that doesn't mean that we cannot store integer values in it. In-fact in embedded micro-controller environment, char is often used for storing one byte integers.

insens350 [35]3 years ago
4 0

Answer:

unsigned char

Explanation:

The different data types with their sizes and range are given as follows,

  • char - 1 byte - Value: -128 - 127
  • unsigned char- 1 byte - Value: 0 - 255

All other data types including integers, float, double require 2 bytes or more. Therefore, the data type with the smallest size that can hold values from 0 to 132 is unsigned char.

You might be interested in
What are the inputs and outputs of a sailboat?
bearhunter [10]

Answer:

  • sailing ships were the primary means of maritime trade and transportation; exploration across the seas and oceans was reliant on sail for anything other than the shortest distances. Naval power in this period used sail to varying degrees depending on the current technology, culminating in the gun-armed sailing warships of the Age of Sail.
7 0
2 years ago
why is the thermal conductivity of super insolation order of magnitude lower than the thermal conductivity of ordinary insulatio
Anni [7]

Answer:

Super insulation are obtained by using layers of highly reflective sheets separated by glass fibers in an vacuumed space. Radiation heat transfer between any of the surfaces is inversely proportional to the number of sheets used and thus heat lost by radiation will be very low by using these highly reflective sheets which will an effective way of heat transfer.

Explanation:

3 0
3 years ago
What is the difference between filler and electrode in Welding? Can a filler be an electrode? Can an electrode be a filler? Why?
Vlada [557]

Explanation:

<u>Filler:</u>

  Filler is the material rod is used when we are joining two material by using welding process.If thickness of work piece is more so it will become compulsory to provide some filler material for making the welding join to withstand high stresses.

<u>Electrode:</u>

  Electrode is the element which is used to complete the electric circuit in welding .Some time electrode is connected with positive terminal and some time with negative terminal ,it depends on the requirement of welding process.In Tungsten inert gas welding electrode is connected negative terminal but on the other hand Metal inert gas welding electrode is connected with positive terminal.Electrode can be consumable non-consumable depends on the condition.

Yes electrode can be work as filler material ,in Metal inert gas welding wire is used as electrode as well as filler material.In Metal inert gas welding consumable electrode is used on the other hand Tungsten inert gas welding non-consumable electrode is used.In Tungsten inert gas welding if thickness of work pieces is less than 5 mm then no need to used any filler material but if thickness is more than 5 mm then we have to use filler material.

8 0
3 years ago
Select four examples of fluid or pneumatic power systems.
Dennis_Churaev [7]

Answer:

Students learn about the fundamental concepts important to fluid power, which includes both pneumatic (gas) and hydraulic (liquid) systems. Both systems contain four basic components: reservoir/receiver, pump/compressor, valve, cylinder.

Explanation:

8 0
3 years ago
Read 2 more answers
What is a Flame Front Generator?
Inessa [10]

Answer and Explanation:

Flame Front Generator: It is a ignition system which is very useful in flaring system .In this system the air and gases are mixed together and make a combustible air gas mixture. There is a flame front region where the combustion reaction takes place , it is the region where gases as like hydrogen and air mixed with each other and form combustible gases.

7 0
3 years ago
Other questions:
  • ¿Cuál era probablemente el activo más valioso de Persia?
    10·2 answers
  • g A plane stress element has components sigma x = 160 MPa, tau xy = 100 MPa (CW). Determine the two values pf sigma y for which
    13·1 answer
  • Bulk wind shear is calculated by finding the vector difference between the winds at two different heights. Using the supercell w
    12·1 answer
  • why HF (hydrogen fluoride) has higher boiling temperature than HCl (hydrogen chloride), even thought HF has lower molecular weig
    8·1 answer
  • Independent auto lots usually have ____ finance rates than dealerships
    7·1 answer
  • A package is thrown down an incline at A with a velocity of 1 m/s. The package slides along the surface ABC to a conveyor belt w
    13·1 answer
  • Can someone Please help me..? If I'm your Onii-San then answer. And get brainliest. Make sure to explain why..
    15·1 answer
  • dentify a semiconducting material and provide the value of its band gap) that could be used in: (a) (1 point) red LED (b) (1 poi
    10·1 answer
  • ) If the blood viscosity is 2.7x10-3 Pa.s, length of the blood vessel is 1 m, radius of the blood vessel is 1 mm, calculate the
    13·1 answer
  • Two children are playing on a seesaw. The child on the left weighs 50 lbs. And the child on the right weighs 100 lbs. If the chi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!