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]
3 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]3 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
A_____refers to the entire Excel file
Veronika [31]
Answer:  workbook

Explanation:
A workbook is the file that holds several worksheets.
The worksheets within a workbook can communicate with each other within the workbook or with other workbooks and their worksheets.
A worksheet within a workbook holds cells that are defined by rows and columns. Worksheets within a workbook can removed and new worksheets can be added.
8 0
3 years ago
When assigned to a cell, the __________ function returns a number that corresponds to the system date and time beginning with De
Sloan [31]

Answer:

Option D: NOW

Explanation:

In Microsoft Excel, NOW function can be used to return a serial number that  corresponds to the system date and time beginning with December 31, 1899.

The NOW function is useful when a date and time is required for calculation or display. The value will be updated each time we open the Excel worksheet.  To use the NOW function, we can type in the formula as follows:

<em>=NOW() </em>

7 0
3 years ago
This is more opinionated than question-based.
kozerog [31]

I think the Iphone is better the Google Pixels. That's just my opinion but some people like google pixels better.

7 0
3 years ago
If a= ‘ Stay home, Stay safe’ , print its value
Damm [24]

Answer:

Since the language isn’t stated, I’ll give answers in the two most-used (?) languages: Java and Python.

a) To print a’s value 3 times in the same line, in Java we would do:

System.out.print(a+a+a);

In Python, we would write:

print(a*3)

b) 2 times in different lines using one print statement

In Java, we would write

System.out.println(a+”\n”+a+”\n”+a);

In Python we would write:

print(a,a,a,sep=’/n’)

Hope this helps!

7 0
2 years ago
Why procedures are used and what must be the lastexecutable instruction in a<br><br> procedure?
Art [367]

Answer:

Procedure are used to create and modifying the programs. Basically, it is grouping of instruction that can be used give direction of the flow of program. Control are given to the next term once the execution of the instruction get over. The steps of procedure are:

procedure are first executed the declaration instruction and then coding the procedure, then it will return to the directories and the last executable instruction is the termination of procedure.

4 0
3 years ago
Other questions:
  • Chloe is building a kiosk-based Excel application. She wants to make some modifications to the screen elements in order to keep
    8·1 answer
  • A(n) ________ address is a temporary ip address assigned from an available pool of ip addresses.
    12·1 answer
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • The family size bottle of sunscreen holds 121212 fluid ounces (\text{fl oz})(fl oz)(, start text, f, l, space, o, z, end text, )
    12·1 answer
  • Which statement will properly start the main() function? def main(): def Main def main# def main[]
    14·2 answers
  • How many times would the following loop iterate?
    15·1 answer
  • Imagine that you have access to a class named MyCircle that has void setRadius(double r) and double getRadius() methods. Write a
    14·1 answer
  • Complete the following sentence.
    7·1 answer
  • tell us things u did as a kid but don't want to admit to it (best gets brainly 5 stasr and a thank you)
    13·2 answers
  • Where can formatting features be found ?! Need help asp !‍♀️
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!