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
When evaluating a website's content, whether or not the information is up to date is considered part of the ________ element.
nirvana33 [79]

The currency element constitutes information whether the information of the website is current or up to date.

<h3>Website</h3>

A website is a term used to describe unique publicly accessible web pages that are identified by a domain name. Information on websites is typically updated by website owners, hence, some websites may not be updated frequently when compared to others. Thus, the currency element is an element users take into consideration when evaluating a website's content, whether or not the information is up to date.

You can learn more about the currency element here https://brainly.in/question/48673521

#SPJ1

3 0
2 years ago
. Many Shakespeare plays deal with the idea of fate andior free will. Is fate something that
saul85 [17]

Answer:

Love cools, friendship falls off, brothers divide: in cities, mutinies; in countries, discord; in palaces, treason; and the bond cracked between son and father" (1.2.58). Later, after Gloucester's enemies blind him and cast him into the wilds, Gloucester says to the loyal old servant attending him, “As flies to wanton boys, are we to the gods.

Explanation:

7 0
3 years ago
Read 2 more answers
Ntering a system call involves changing from kernel mode to user mode.<br><br> a. true <br> b. false
Evgesh-ka [11]

The given statement exists true. Ntering a system call concerns varying from kernel mode to user mode.

<h3>What is kernel mode?</h3>

A processor in a computer operating Windows contains two various modes: user mode and kernel mode. The processor switches between the two modes relying on what kind of code exists operating on the processor. Applications run in the user way, and core operating system features run in kernel mode.

The transition from the user mode to kernel mode happens, when the application demands the service of the operating system or an interrupts or a system call happens. The mode bit exists set to 1 in the user mode. When a program requires any hardware resources, it must create a call to the kernel.

Therefore, the correct answer is option a. true.

To learn more about kernel mode refer to:

brainly.com/question/15830364

#SPJ4

5 0
1 year ago
10.For advertisement the company print design, the marketing team required a website from the IT staff. Which language is used i
ale4655 [162]

Answer:

For advertisement the company print design, the marketing team required a website from the IT staff. Which language is used in website designing?

8 0
3 years ago
Josh wants to sign up for a gaming website. It will allow him to download games. He can’t find a privacy policy. Should he join
docker41 [41]

Answer:

c

Explanation:

process of elimination

3 0
3 years ago
Read 2 more answers
Other questions:
  • The classification of clouds is based on their _____.
    5·2 answers
  • Are u a chicken nugget!!??
    14·2 answers
  • To write 10 lines of code on paper:
    10·1 answer
  • How to make a cartoon can we use adobe flash
    7·2 answers
  • Miriam is very detail oriented within the first month of her new job as a network support specialist she became very good at dia
    12·1 answer
  • Type the correct answer in the box.
    5·1 answer
  • This is Very very Important to me[BRAINLIEST)✅​
    5·1 answer
  • How does Shakespeare immediately introduce Tybalt as a menacing character?
    9·1 answer
  • References inserted initially as footnotes can be converted to endnotes through an option in the software.
    10·2 answers
  • What role do play in medicine ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!