What will you do to treat the constant 3.14 as a long double?

What will you do to treat the constant 3.14 as a long double?

A.  use 3.14LD

B. use 3.14L

C. use 3.14DL

D. use 3.14LF

Hướng dẫn

Chọn B là đáp án đúng

Xem lời giải

Xem lời giải

Hằng số 3.14 là kiểu double, 3.14L là kiểu long double

Tags:

What will you do to treat the constant 3.14 as a float?

What will you do to treat the constant 3.14 as a float?

A. use float(3.14f)

B. use 3.14f

C. use f(3.14)

D. use (f)(3.14)

Hướng dẫn

Chọn B là đáp án đúng

Xem lời giải

Xem lời giải

Bạn có thể test bằng câu lệnh: sizeof(3.14f) = 4 (byte) (Visual C++ 2008 x86)

Tags: