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
Elanso [62]
3 years ago
9

Create a program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt. Assign the f

ollowing values to the integers: 23 to firstInt 45 to middleInt 67 to lastInt Then display the values and pass them to a method named Reverse that accepts them as reference variables, places the first value in the lastInt variable, and places the last value in the firstInt variable.
Computers and Technology
1 answer:
Elodia [21]3 years ago
7 0

This question is incomplete. The complete question is given below:

Create a C# Console program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt.

Assign the following values to the integers:

23 to firstInt

45 to middleInt

67 to lastInt

Then display the values and pass them to a method named Reverse that accepts them as reference variables, places the first value in the lastIntvariable, and places the last value in the firstInt variable.

In the Main() method, display the three variables again, demonstrating that their positions have been reversed.

using static System.Console;

class Reverse3

{

static void Main()

{

// Write your main here

}

public static void Reverse(ref int a, ref int b, ref int c)

{

}

}

Answer:

using static System.Console;

class Reverse3

{

      static void Main()

       {

           int firstInt = 23;

           int middleInt = 45;

           int lastInt = 67;

           Console.WriteLine("Before reversing: firstInt: " + firstInt + ", middleInt: " + middleInt + ", lastInt: " + lastInt);

           Reverse(ref firstInt, ref middleInt, ref lastInt);

           Console.WriteLine("After reversing: firstInt: " + firstInt + ", middleInt: " + middleInt + ", lastInt: " + lastInt);

       }

       public static void Reverse(ref int a, ref int b, ref int c)

       {

           int temp = c;

           c = a;

           a = temp;

       }

}

Explanation:

Inside the main() method, initialize the variables firstInt, middleInt, lastInt with 23, 45 and 67 respectively. Then print the values of all these variables on the console. Call the Reverse method and pass these variables as references. Print the updated values of all these variables on the console.

Inside the Reverse method, swap the values of firstInt with the lastInt by initializing the temp variable with c.

Output:

Before reversing: firstInt: 23, middleInt: 45, lastInt: 67

After reversing: firstInt: 67, middleInt: 45, lastInt: 23

You might be interested in
What’s my password for this app
FrozenT [24]

Answer:

I guess there isnt any password!

Explanation:

7 0
3 years ago
Read 2 more answers
To make a duplicate of text, image,chart,graphs etc.​
Veronika [31]

Explanation:

You can change the formatting of the rest of the text ( bold, italics, font color or sixe, ect)

5 0
3 years ago
Why some programming languages use compilers and other interpreters ?​
Inga [223]

Answer:

A compiler takes a lot of time to analyze the source code. However, the overall time taken to execute the process is much faster. An interpreter does not generate an intermediary code. Hence, an interpreter is highly efficient in terms of its memory.

Explanation:

5 0
2 years ago
According to the lecture, in communication, men tend to value ____________.
Andru [333]

Answer:

respect?

Explanation:

8 0
3 years ago
Which telemetry is used for monitoring astronauts in space​
agasfer [191]

Answer:

I believe it is medical telemetry

5 0
3 years ago
Read 2 more answers
Other questions:
  • What acts as a platform on which application software runs?
    8·1 answer
  • The answer is family and friends
    8·2 answers
  • What is the output of the following code? public class Test { public static void main(String[] args) { String s1 = new String("J
    9·1 answer
  • Well I am having trouble and I feel really bad because I helped RandomGuy1 who rubs it in my face that I gave him the wrong answ
    15·1 answer
  • Which of the following is a step in paraphrasing?
    14·2 answers
  • What can your employer do to protect you from overhead power lines?
    13·1 answer
  • This matches the domain name with the correct IP address:
    12·1 answer
  • What makes a source credible?
    9·2 answers
  • Simple example of hybrid computer​
    7·2 answers
  • To set up scenarios, you need to first use ______ to set up a list, then ______ to set up the reference cell. Last you need to u
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!