Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (TypeSze Problem) For any primitive type given by a user, print the memory space (i.c size) allocated to this type using sizeof (... function.
2. (TypeSze Problem) For any primitive type given by a user, print the memory space (i.c size) allocated to this type using sizeof (... function. Example behavior of your program is (red font is user input) This is a calculator of size of a type 0) int type 1) float type n) Exit Please type a number to select a type: 0 The size of int type is 4 bytes (to be continued next page) 0) int type 1) float type n) Exit Please type a number to select a type: Note that if user type n, your program should show the main menu in 1. You get maximum of90% of this question if you include only all basic types in L7. The maximum will be 100% if you can address modifiers (long, short, signed, unsigned). As an example, the size of the type unsigned short int is 2 bytes. With modifiers, your menu may be very long. You may use a three-level menu, the first level and second allows the user to choose modifiers while the last level allows the user to choose a basic type. In the first two levels o f menu, user should have the option of choosing no modifiers
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