Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Program 1. Define the purpose of the following C/C++ data types. Write a C or C++ program that stores the listed values in the
C++ Program
1. Define the purpose of the following C/C++ data types. Write a C or C++ program that stores the listed values in the variables. In your program write a code that enables you to determine the size of each variable (check out the instruction sizeof0). Write a code that enable you to see the address of each variable (check out the operator &). In the table determine the address of the first element and the last element. Show whether all the elements are in the ascending order. What is the difference in the address of consecutive elements in each variable type, explain your answer. If the variable is more than 1 byte, expand the program to determine whether your processor is using Big Endian or Little Endian byte order. Display your elements in binary, hex, and decimal. When you display your element, does the processor change the content of your element in order to display (a) Char (declare variables and store in them: 48, 73, 97, 121) (b) Char table (declare a table of elements and store in them: 41, 65, 89, 113) (c) Short (declare variables and store in them: 48, 73, 97,121, -48, -73, - 97, -121 (d) int (declare a table of 4 elements and store in them: 41, 65, 89,113, -41, -65, -89, -113) (e) float (declare a table of4 elements and store in them: 0.1, 0.25, 0.5, 1.5) (f) double (declare a table of 4 elements and store in them: 0.1, 0.25, 0.5, 1.5)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started