1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
scoray [572]
3 years ago
7

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

alue. 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.
Computers and Technology
1 answer:
Tju [1.3M]3 years ago
8 0

Answer:

The DoubleDecimalTest class is as follows:

using System;

class DoubleDecimalTest {

 static void Main() {

     double doubleNum = 173737388856632566321737373676D;  

    decimal decimalNum = 173737388856632566321737373676M;

   Console.WriteLine(doubleNum);

   Console.WriteLine(decimalNum);  } }

Explanation:

Required

Program to test double and decimal variables in C#

This declares and initializes double variable doubleNum

     double doubleNum = 173737388856632566321737373676D;

This declares and initializes double variable decimalNum (using the same value as doubleNum)

     decimal decimalNum = 173737388856632566321737373676M;

This prints doubleNum

   Console.WriteLine(doubleNum);

This prints decimalNum

   Console.WriteLine(decimalNum);

<em>Unless the decimal variable is commented out or the value is reduced to a reasonable range, the program will not compile without error.</em>

You might be interested in
The presentation ____ determines the formatting characteristics of fonts and colors.
leonid [27]
The presentation theme determines the formatting characteristics of fonts and colors.
6 0
3 years ago
Read 2 more answers
Mobile devices need to work within limited screen space .
zloy xaker [14]
True. Mobile devices need to work within limited screen space. Mobile devices are designed to be portable and designed to be carried around without hassle. Mobile devices are used for personal activities such as talking privately, chatting and many more that is why it is designed to be small.
3 0
3 years ago
The recommended flux for electrical soldering is A. antimony. B. sal ammoniac. C. rosin. D. muriatic acid.
expeople1 [14]
I pretty sure its D muriatic acid
3 0
3 years ago
Benefits of etherchannel
Mariana [72]
An ether channel can give you high speed interface if it is successfully engineered. Combining 2 or more ethernet lets you create a logical ethernet link providing high speed links between switches. Also having etherchannel gives you a higher band width than what you costumed for.
5 0
3 years ago
Help please what is the answer , thanks!!!
shepuryov [24]

Answer:

X = "Hello World"

Y = "hello world"

Z = 100

C = 200

if X == Y:

   print("TRUE")

else:

   print("FALSE")

if Z > C:

   print("TRUE")

else:

   print("FALSE")

4 0
2 years ago
Other questions:
  • Tonya is working with a team of subject matter experts to diagnose a problem with her system. The experts determine that the pro
    14·1 answer
  • Which table option automatically adjusts column widths to fit cell content? autofit contents merge cells autofit window fixed co
    5·1 answer
  • At age 16 Cheyanne just got her drivers license
    5·2 answers
  • Traceability of requirements is helpful in the followingexcept
    5·1 answer
  • assume an int array, candy, stores the number of candy bars sold by a group of children wherecandy[j] is the number of candy bar
    7·2 answers
  • Site won't let me log in and is glitching? Is rainly down?
    15·2 answers
  • (You don’t have to answer it’s just for you for points. Here is you’re riddle)
    9·2 answers
  • What is an operating system? What are the main functions of a modern general purpose operating system?
    7·1 answer
  • Which of the following is an example of a long-term goal?Developing a lifetime savings plan
    11·1 answer
  • What is a common use for append queries?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!