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
A command is
Alona [7]

Answer:

D

Explanation:

4 0
3 years ago
All of the fossils that have been discovered make up the
erastovalidia [21]

Answer:

D. fossil record

Explanation:

When animals and plants died in historical times , in some cases their remains were preserved as imprints on rocks. These constitute fossil records and provide lot of information about evolution of life. These fossil records when arranged chronologically in order of time, constitute a fossil record. Fossil Record provides a very valuable indirect insight about historical times to archaeologists.

6 0
3 years ago
I.C.T
oee [108]

Soft and hard copies in my opinion

8 0
3 years ago
Read 2 more answers
What is the most popular game design engine today
kirill [66]

Unreal Engine and Unity

8 0
3 years ago
Read 2 more answers
What is the storage capacity of floppy disk​
11111nata11111 [884]

Answer:

1.44 MB

Explanation:

Today, the most commonly used floppy disks are 3.5 inches and have the capacity of 800 KB to 2.8 MB (with a standard of 1.44 MB).

Hope this helps!

7 0
3 years ago
Other questions:
  • What cable should i be using to connect my android tablet to the pc?
    13·2 answers
  • Create a program named MealPriceCalculation that prompts users enter a meal price and the tip and then calculate and display the
    13·1 answer
  • Two of the major sources used today for obtaining information to create computer maps are satellites and _____________.
    11·2 answers
  • Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
    9·1 answer
  • Which of the following is a career that's indirectly linked to careers in web technologies?
    10·1 answer
  • Highlights the possible risks and problems that should be addressed during the implementation process
    6·1 answer
  • Explain the developement of modern technology?
    13·2 answers
  • Which are examples of primary sources? Check all that apply.
    15·2 answers
  • Select the correct answer.<br><br> Which statement is true with respect to Java?
    6·1 answer
  • Similar to Wi-Fi, ____ is designed to provide Internet access to fixed locations (sometimes called hotzones), but the coverage i
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!