Asked by Musbahu Rabiu
Laboratory Work No. 1
Memory Representations of Primitive Data
In this laboratory work, you should research and find a solution (proved by C code) for each task below:
a) How many bits a byte equals to?
b) How many bytes a basic data type (char, int, float, and double) occupies in memory?
c) How many bits an integer variable occupies in memory?
d) What is the minimum and maximum value a character variable can store?
e) What is the minimum and maximum value a short-integer variable can store?
f) What is the minimum and maximum value an integer variable can store?
g) What range of values can be stored in a single-precision floating-point variable?
h) Write a C program that bitwise displays the character value ‘A’ to the screen.
i) Write a C program that bitwise displays the short-integer value 167 to the screen.
j) Write a C program that bitwise displays the single-precision-floating-point value 3.14 to the screen.
Note that you can write a few functions and/or assemble all tasks in a single C program.
Hint: There are some header files in C that can be used for answering the tasks above
Memory Representations of Primitive Data
In this laboratory work, you should research and find a solution (proved by C code) for each task below:
a) How many bits a byte equals to?
b) How many bytes a basic data type (char, int, float, and double) occupies in memory?
c) How many bits an integer variable occupies in memory?
d) What is the minimum and maximum value a character variable can store?
e) What is the minimum and maximum value a short-integer variable can store?
f) What is the minimum and maximum value an integer variable can store?
g) What range of values can be stored in a single-precision floating-point variable?
h) Write a C program that bitwise displays the character value ‘A’ to the screen.
i) Write a C program that bitwise displays the short-integer value 167 to the screen.
j) Write a C program that bitwise displays the single-precision-floating-point value 3.14 to the screen.
Note that you can write a few functions and/or assemble all tasks in a single C program.
Hint: There are some header files in C that can be used for answering the tasks above
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.