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
What are the main dimensions of information system and their components
nydimaria [60]

Answer:

The dimensions of information systems include organizations, management, and information technology. The key elements of an organization are its people, structure, business processes, politics, and culture. An organization coordinates work through a structured hierarchy and formal standard operating procedures.

7 0
3 years ago
Which one did I buy the iPhone 13 or the Samsung S22 Ultra?
SVETLANKA909090 [29]

Answer:

iphone 13

Explanation:

6 0
2 years ago
Read 2 more answers
How to convert meters to centimeters in c programming​
mote1985 [20]

Answer:

Input

Enter length in centimeter = 1000

Output

Length in meter = 10 m

Length in kilometer = 0.01 km

Explanation:

hope this helps

5 0
3 years ago
Which are among the ways you can use bitlocker encryption? (choose all that apply?
igor_vitrenko [27]
There is a lot of ways that you can use the bit locker encryption. Some are when you are authenticating your computer using a TPM. Or when you are authenticating your account using a USB Flash drive, and most on the phones authentication through text messages and all.
3 0
3 years ago
If your network subnet mask is /16, what is the maximum number of host ids available for this network?
kupik [55]
65534






-------------------------------------------
8 0
3 years ago
Other questions:
  • If you want to boot from a hard drive what must it have
    6·1 answer
  • _____ allow(s) a user to double click with the mouse in a document to move the insertion point to a new location.
    11·1 answer
  • ____ is the name of a particularly nasty automated program that attacks a network by exploiting Internet Protocol (IP) broadcast
    15·1 answer
  • What are the pros and cons of editorial anonymity in Wikipedia
    10·2 answers
  • Ebba received a message from one of her tech support employees. In violation of company policy, a user had downloaded a free pro
    14·1 answer
  • Convert the following hexadecimal numbers to decimal numbers. (Show your work) a. 0xE3 b. 0x4A c. 0xF9
    10·1 answer
  • Calculate the cash available to retire debt for each of the six months. There is cash available to retire debt if there is a cas
    8·1 answer
  • 1)Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "positive" otherwise. Examp
    15·2 answers
  • Most C++ catastrophe vulnerabilities rely on uninitialized function pointers in a class.
    13·1 answer
  • Years ago when working a helpdesk, the most common question asked, almost daily, was about resetting passwords. What type of kno
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!