Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c/C++ programming 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.

imagec/C++ programming

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.

Step by Step Solution

3.33 Rating (117 Votes )

There are 3 Steps involved in it

Step: 1

The detailed answer for the above question is provided below ANSWER 1 E Its value is always 8 The st... blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excellence in Business Communication

Authors: John V. Thill, Courtland L. Bovee

9th edition

136103766, 978-0136103769

More Books

Students also viewed these Electrical Engineering questions