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
Trava [24]
4 years ago
7

Would these statements cause an error? Why or why not? int year = 2019; int yearNext = 2020; int & ref = year; & ref = y

earNext;
Computers and Technology
1 answer:
zalisa [80]4 years ago
3 0

Answer: YES

Explanation:

int year=2019;

int yearNext=2020;

 int &ref=year;

<em>&ref=yearNext</em>; {This line leads to error as references cannot be reassigned}

(//compilation error: lvalue required as left operand of assignment

) lvalue(&ref) is not something which can be assigned.

To get this better, here are the difference between pointers and reference variables

Pointers

Pointers can be incremented

Array can be formed with pointers

Pointers can be reassigned

Pointer can be declared as void  

Reference variable

References cannot be incremented

Array cannot be formed with references

References cannot be reassigned as references shares the address of the variable its assigned

References can never be void

You might be interested in
Which functions can you use to find the square root of a number, and to find the current date, respectively?
JulsSmile [24]

1. A. the SQRT is the squareroot. 2. may be C. Today but I've never heard of a function that returns the date!

8 0
3 years ago
Read 2 more answers
which of the following electromagnetic waves are not used for communication? a.gamma rays b.microwaves c.infrared waves d.radio
Flura [38]

Gamma rays are not used for communication.

-- We have no safe way to generate them.
-- We have no cheap way to detect them.
-- We have no way to impress information on them (modulate them).
-- They're dangerous.

Otherwise they're ideal for communication.


3 0
3 years ago
You want to look up colleges but exclude private schools. Including punctuation, what would you
Orlov [11]

Answer:

the 3rd

Explanation:

8 0
4 years ago
Read 2 more answers
The Fibonacci numbers are the numbers
Doss [256]

Answer:

function fibonacci(n):

  if n is equal to 1 or n is equal to 2:

       return 1

  else:

       return fibonacci(n-1) + fibonacci(n-2)

end of the function

Input the n

Print fibonacci(n)

Explanation:

* The above algorithm (pseudocode) is written considering Python.

Create a function called fibonacci that takes one parameter, n

If n is equal to 1 or 2, return 1 (When n is 1 or 2, the fibonacci numbers are 1)

Otherwise, return the sum of the two previous numbers (When n is not 1 or 2, the fibonacci number is equal to sum of the two previous numbers)

Ask the user for n

Call the function, pass n as a parameter and print the result

6 0
3 years ago
________ technologies are technologies that enable the incremental improvement of products and services.
nikdorinn [45]

<u>Sustaining</u> technologies are technologies that enable the incremental improvement of products and services.

Sustaining technology refers to the constant improvement of industrial activities which includes cost efficiency, product quality, and time.

Sustaining technology differs from disruptive technology in that disruptive technology identifies new opportunities and creates new products and services that the customers don't know about while sustaining technology enables the companies to compete with other associations by improving the products and services that the consumers already know about.

Sustaining technology works by identifying the needs and demands of the consumers and customers and can sometimes be a slow method.

Sustaining technologies enable companies to maintain their existing customer base and at the same time improve their existing products.

To learn more about sustaining technologies, click here:

brainly.com/question/14838154

#SPJ4

4 0
2 years ago
Read 2 more answers
Other questions:
  • Toshiba Corporation makes computer chips. Toshiba Corporation would be classified as a A. merchandising company. B. manufacturin
    15·1 answer
  • Multisensory input/output devices, such as data gloves or jumpsuits, are commonly used with _______________ systems.
    12·1 answer
  • In this chapter, you saw an example of how to write an algorithm that determines whether a number is even or odd. Write a progra
    6·2 answers
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • What is a required device(s) used to connect to an ISP Network?
    12·2 answers
  • What is unit testing? a. Checking that the integer values of a function use proper units (yards, meters, etc.) b. Ensuring a pro
    8·1 answer
  • 1. I write about my travel experiences on my own personal ____?
    12·1 answer
  • Star and peer-to-peer are types of
    9·2 answers
  • Which of the following is not a secondary memory. (a) pen drive (b) Hard disk (c) Ram (d) Magnetic disk
    8·1 answer
  • Read three integers from user input without a prompt. Then, print the product of those integers. Ex: If input is 2 3 5, output i
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!