c/C++ programming 1. Which of the following is wrong regarding the standard macro named CHAR_BIT? (Note 2.3)
Fantastic news! We've Found the answer you've been seeking!
Question:
c/C++ programming
Transcribed Image Text:
1. Which of the following is wrong regarding the standard macro named CHAR_BIT? (Note 2.3) A. You must never define it yourself. B. It is available in header files limits.h and climits. C. It represents the number of bits in a byte (in data type char). D. Program code should use it instead of a literal 8 to represent the number of bits in type char. Its value is always 8 E. 2. If your program needs both integer and floating variables and if any type from each category will work, which are usually preferred, respectively? (Notes 2.1 & 2.4) A. char and float B. int and float C. unsigned int and double D. int and double E. long long int and long double 3. The data types of the literals 2 and 2.0, respectively, are: (Notes 2.1, 2.2, & 2.4) A. integer and long double B. int and double C. int and floating D. int and float E. implementation dependent 4. What is the data type of an expression containing only type char and type short operands? (Note 2.10) A. char B. short C. char, unsigned char, or short D. int or unsigned int E. int or long 5. What is the biggest problem with macro SUM below, which is intended to represent the sum of 5 and 32 #define SUM 5+3 (Note 2.13) A. Its value might not be 8 B. It contains magic numbers. C. There is no space around the + operator. D. Macros are not supported in C++. E. There is no major problem. 6. What is wrong with: printf("%u", sizeof(double)); (Note 2.12) A. There is nothing wrong. B. sizeof(double) should be C. sizeof(unsigned int) to match the %u. The data type produced by sizeof might not be compatible with %u. D. printf cannot reliably display values produced by sizeof. E. The value produced by sizeof might be negative. 1. Which of the following is wrong regarding the standard macro named CHAR_BIT? (Note 2.3) A. You must never define it yourself. B. It is available in header files limits.h and climits. C. It represents the number of bits in a byte (in data type char). D. Program code should use it instead of a literal 8 to represent the number of bits in type char. Its value is always 8 E. 2. If your program needs both integer and floating variables and if any type from each category will work, which are usually preferred, respectively? (Notes 2.1 & 2.4) A. char and float B. int and float C. unsigned int and double D. int and double E. long long int and long double 3. The data types of the literals 2 and 2.0, respectively, are: (Notes 2.1, 2.2, & 2.4) A. integer and long double B. int and double C. int and floating D. int and float E. implementation dependent 4. What is the data type of an expression containing only type char and type short operands? (Note 2.10) A. char B. short C. char, unsigned char, or short D. int or unsigned int E. int or long 5. What is the biggest problem with macro SUM below, which is intended to represent the sum of 5 and 32 #define SUM 5+3 (Note 2.13) A. Its value might not be 8 B. It contains magic numbers. C. There is no space around the + operator. D. Macros are not supported in C++. E. There is no major problem. 6. What is wrong with: printf("%u", sizeof(double)); (Note 2.12) A. There is nothing wrong. B. sizeof(double) should be C. sizeof(unsigned int) to match the %u. The data type produced by sizeof might not be compatible with %u. D. printf cannot reliably display values produced by sizeof. E. The value produced by sizeof might be negative.
Expert Answer:
Answer rating: 100% (QA)
The detailed answer for the above question is provided below ANSWER 1 E Its value is always 8 The st... View the full answer
Related Book For
Excellence in Business Communication
ISBN: 978-0136103769
9th edition
Authors: John V. Thill, Courtland L. Bovee
Posted Date:
Students also viewed these electrical engineering questions
-
C Programming - Standard Scientific Notation: A real number, n, can be written in standard scientific notation if it is represented by its mantissa, m, and its exponent, e. The mantissa is a real...
-
Rewrite the C program segment of Programming Exercise 4 using if and goto statements in C. Data From Exercise 4: Consider the following C program segment. Rewrite it using no gotos or breaks. j = -3;...
-
Rewrite the C program segment of Programming Exercise 4 in Java without using a switch statement. Data From Exercise 4: Consider the following C program segment. Rewrite it using no gotos or breaks....
-
How can adults continue to function relatively normally after surgery to remove the thymus, tonsils, spleen, or lymph nodes?
-
Use the accounting equation to compute the missing financial statement amounts (a), (b), and(c). Company Equity Assets S 30,000 b) 90,000 Liabilities $ (a) 2 3 50,000 10,000 30,000
-
A 2.0-cm-tall object is 20 cm to the left of a lens with a focal length of 10 cm. A second lens with a focal length of -5 cm is 30 cm to the right of the first lens. a. Use ray tracing to find the...
-
Following are the annual amounts of rainfall, in inches, in six randomly chosen cities for two consecutive years. Can you conclude that the mean rainfall was greater in year 2 than in year 1? a. Let...
-
Adverse Opinion. The board of directors of Cook Indus-tries Inc. engaged Brown & Brown, CPAs, to audit the financial statements for the year ended December 31, 2014. Required: Identify the...
-
1.Suppose a relative put aside $1,000 for your education and other future expenses in mid-2006.If they placed these funds in the Blue Chip Growth Fund, what would it be worth as of May 31, 2016 ?...
-
Carl Kay is the vice-president of KM Ltd., a Canadian-controlled private corporation located in Halifax, Nova Scotia. KM operates a real estate development business constructing and selling...
-
Gavin Thorpe, Production Director, is concerned about the handling of raw materials into production at the new production facility. Apparently, raw materials are not always placed in the correct...
-
What is Sales Force Automation Function inside the Sales Marketing System. Describe Brielfy.
-
Find the domain of the function. g(x) = 2 X x+10x+21
-
1. For the structure shown in Figure 1, determine (i) the unknown displacements at all the considered nodes, (ii) the strains as well as (iii) the stresses for each and every of the involved constant...
-
1. Amsterdam Company owns the mineral rights to land that has a deposit of ore. The company in uncertain if it should purchase equipment and open a mine on the property. After careful study, the...
-
A company acquired as a long - term investment $ 1 5 0 million of 4 . 0 % bonds, dated July 1 , on July 1 , Year 1 . Company management has the positive intent and ability to hold the bonds until...
-
Snake Game in Java Game Description: In a snake game such as Nibbles (see https://en.wikipedia.org/wiki/Nibbles_(video_game)) the objective is to navigate a snake through a walled space (or maze),...
-
What is removed during each of the three stages of wastewater treatment: primary, secondary, and tertiary? During which state would you expect items to be recovered that were accidentally flushed,...
-
What are the ethical implications of murky, complex writing in a document that is supposed to explain how customers can appeal the result of a decision made in the company's favor during a dispute?
-
JetBlue is known for its innovations in customer service and customer communication, including its pioneering use of the Twitter microblogging system. Thousands of JetBlue fans and customers follow...
-
As the owner of Paradise Sportswear in Hawaii, Robert Hedin was nearly done in by Hurricane Iniki in 1992, which wiped out his first silk-screened and airbrushed T-shirt business. He tried again, but...
-
An unrecorded check issued during the last week of the year would most likely be discovered by the auditor when the a. Check register for the next month is reviewed. b. Bank confirmation is reviewed....
-
Which of the following cash transfers results in a misstatement of cash at December 31, 19X7? Disbursement Bank Transfer Schedule Receipt Recorded Paid by Recorded Received Transfer in books bank in...
-
The auditor should ordinarily mail confirmation requests to all banks with which the client has conducted business during the year, including those with zero balances because a. This procedure will...
Study smarter with the SolutionInn App