1.5k views
0 votes
Given two integer variables oldRecord and newRecord, write a statement that gives newRecord the same value that oldRecord has

User Wind
by
4.6k points

1 Answer

1 vote

Answer:

Given;

int oldRecord;

int newRecord;

newRecord = oldRecord;

Step-by-step explanation:

The above code has been written in Java.

Two integer variables, oldRecord and newRecord have been given.

To assign the value of oldRecord to newRecord, we should use the assignment operator (=) as follows;

newRecord = oldRecord;

Note: the variable that is to be assigned a value (newRecord) should be on the left hand side of the equation while the value to be assigned to it (oldRecord) should be on the right hand side.

Hope this helps!

User Rohit Luthra
by
5.9k points