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
Debora [2.8K]
1 year ago
9

should variables that contain numbers always be declared as integer or floating-point data types? why or why not? name potential

examples.
Computers and Technology
1 answer:
Stells [14]1 year ago
6 0

No, it is not necessary that variables that contain numbers should always be declared as integer or floating-point data types.

It is not necessary that variables that contain numbers should be declared as integer and floating point data types. Because number can be declared with different data types.  As we know that data type is a vital aspect in programming. It describes the type of a value that is contained in a variable. It is the data type based on which memory is allocated to a number or any type of variables.

Numbers can be whole decimal/fractional, signed, unsigned, small, and long. Simply, they exist in a variety of values. According to their values range, the amount of memory is reserved.

Different programming languages offer different data types to store numbers, depending on their types and size. Let’s consider some examples of data types used in programming languages in order to declare variables holding numbers.

  • In Python int, float, and complex are the data types used to declare number type variables.
  • SQL uses INTEGER, SMALLINT , BIGINT , NUMERIC() , and DECIMAL() data types for numbers.
  • To deal with number type variables, Java has six predefined data types, such as int, long, short, byte, float, and double.
  • JavaScript uses a single data type called 'number' to declare numbers.
  • In C++, two fundamental data types, int and float, are used to represent numeric variables. But C++ is not only limited to these two data types. The data type char can also store numbers. Other data types for declaring numbers as variables are derived from int, float and char, such as short int, long int, signed int, unsigned int, double, long double, signed char, unsigned char etc. etc.

So in concluding remarks, declaring a number type variable is not only limited to using integers and floating-points data types. Rather it entirely depends on the respective programming language, and size and type of the number to be stored in the variable.

You can learn more about data types at

brainly.com/question/13438922

#SPJ4

You might be interested in
The first computer introduced was the IBM PC. A. True B. False
Lerok [7]
The answer to your question is true
5 0
2 years ago
Read 2 more answers
What term is used to refer to the requesting of information from a database?
nekit [7.7K]

The answer is: Querying

3 0
2 years ago
Read 2 more answers
A(n) ____ is an attack that takes advantage of a system vulnerability.
jarptica [38.1K]
<span>Exploit -</span> An attack that takes advantage of a system vulnerability, often<span> due to a combination of one or more improperly configured services.</span>
8 0
3 years ago
Blender questions
Tamiku [17]
<span>14. A mesh represents a(n) _____ object if its faces enclose a positive and finite amount of space. (1 point)

odd

connected

simple

convex



15. Which of the following is the 3-D view port? (1 point)

the standard layout used for new files

the polygon viewing on the default screen

straight line segments connecting two vertices

a single static image in 3-D

The answer for number 1, should be:
SOLID
</span><span>A mesh represents a solid object if its faces enclose a positive and finite amount of space
</span>
The answer for the second question is:
a single static image in 3-D
4 0
2 years ago
Read 2 more answers
Write a Python function to determine the volume of material remaining after the hole is drilled. The function should take as inp
Andru [333]

Answer:

height = int(input ("Enter height : ") )

print (height)

width = int( input("Enter length : ") )

print (width)

half_width =width/2

half_height=height/2

while 0==0:

   radius = float( input("Enter radius : ") )

   print (radius)

   

   if radius<half_width and radius <half_height:

       break

def remainingVolume(height,width,radius):

       

   vol_box=height*width*width

   print (vol_box)

   vol_hole=3.14178*radius*radius*height

   print (vol_hole)

   

   remaining_vol=vol_box-vol_hole

   print ("Remaining volume is ",remaining_vol)

   

remainingVolume(height,width,radius);

Explanation:

Take input from user for height ,width and radius. To find volume of box formula is vol=height* width*length\\

Let's assume width and length is same so

length= width

Using this formula of box volume find box volume.Now find volume of hole.

Consider hole as small cylinder, find volume of cylinder and subtract from volume of box to get remaining volume of box after hole.

vol_of_cyl=\pi radius^{2} height

5 0
2 years ago
Other questions:
  • Which change signaled a musical progression toward rock and roll?
    14·1 answer
  • What the address for dns server that the eorkstation will use?
    10·1 answer
  • A friend complains that she is always running out of money even though she “never buys anything expensive.” What advice would yo
    10·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • Select the correct answer.
    10·2 answers
  • What is NOT a built-in function in python?<br> sqrt()<br> string()<br> fabs()<br> O print()
    12·2 answers
  • Who wants brainlyest! NO LINKS how do you message someone on brainly
    10·2 answers
  • In two to three sentences, define "home row" and explain why it is important.
    6·2 answers
  • What color pixels are used in a camera?
    10·2 answers
  • Without using parentheses, enter a formula in cell F4 that
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!