Question: C# ONLY In this chapter, you learned that although a double and a decimal both hold floating-point numbers, a double can hold a larger value.

C# ONLY

In this chapter, you learned that although a double and a decimal both hold floating-point numbers, a double can hold a larger value.

Write a C# program named DoubleDecimalTest that declares and displays two variablesa double and a decimal.

Experiment by assigning the same constant value to each variable so that the assignment to the double is legal but the assignment to the decimal is not.

In other words, when you leave the decimal assignment statement in the program, an error message should be generated that indicates the value is outside the range of the type decimal, but when you comment out the decimal assignment and its output statement, the program should compile correctly.

Note: Leave the decimal assignment statement in the program on final submission.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!