Question
I need assistance with this code. 1. In Chapter 2, you learned that although a double and a decimal both hold floating-point numbers, a double
I need assistance with this code.
1. In Chapter 2, 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 variables - a 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.
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