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 website can help you find antivirus software
WITCHER [35]
<span>CNET hope this helps</span>
4 0
3 years ago
Read 2 more answers
Select the best word or phrase to complete each sentence Jobs that require you to use your v are typically rewarding Individuals
Maslowich

Answer:

aptitudes

personalities

openness

potential career choices

communication skills

current skill levels

Explanation:

7 0
3 years ago
Queries are questions true or false?
makkiz [27]
True

…………………………………………………..
5 0
3 years ago
Please help im not good at computer class ​
Veronika [31]

Answer:

W.

Explanation:

4 0
3 years ago
Read 2 more answers
Which image property helps to create distinction between the highlights and shadows of an object?
Nutka1998 [239]
I know filters, so I know it is Saturation.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a MATLAB code which asks a user for an integer number and computes the factorial of that number. Use while loop to create
    11·1 answer
  • What does the CPU do in a computer?
    7·2 answers
  • Briley has all the hardware she needs to construct a fully functional personal computer. She connects the various components and
    7·1 answer
  • Who distributes IP Address?
    10·1 answer
  • What should be used to keep a tablet dry?
    13·1 answer
  • PrimeFactorization.java: Write a program that begins by reading in a series of positive integers on a single line of input and t
    12·1 answer
  • Fill in the blank
    15·2 answers
  • 1.
    9·1 answer
  • -) An attribute is a(n)?
    5·1 answer
  • What is an operating system that controls some aspects of the computer?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!