2. In an assignment statement it may be necessary to convert the data type ( Type Conversion ). Explain what is meant by narrowing and widening conversion as follows for example in C, C ++, or Java programming language.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.Question 1
Primitive data types are provided by default to users by the programming language to use for further block constructions. These are considered “fundamental” or “predefined” types and can be used by users to construct other types (e.g. abstract, structures). They store single values and define both variables and constants. In C++, there are seven primitive data types, as follows:
• char – can appear with “signed” or “unsigned” and represents either a character or a small integer (usually it requires 1 byte regardless the C++ used compiler);
• int (stands for “integer”) – it can be “short”, “normal”, “long” or “long long” (depending on the amount of bytes used for storage); the ranges vary accordingly for each case (in general, 2/4/8 bytes); it can be used in combination with “unsigned” or “signed”;
• bool (stands for “Boolean”) – requires one byte and has two values: true & false;
• float – represents a real number on 4 bytes using single-precision representation;
• double – represents a real number using double-precision floating point scheme (8 bytes);...