Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:38:45+00:00 2026-06-12T16:38:45+00:00

I am writing a small console application in C# using Visual Studio. I want

  • 0

I am writing a small console application in C# using Visual Studio.

I want to write two small programs, both will take six integers entered via the console and then the if statements will compare all six values and the end result will be console outputs printing the six values entered and the values in order from highest to the lowest. I am racking my brains trying to figure out how to do this.

Once I have done this I will write a second program to do this using a list which I think will be neater.

So I think there should be six integers to hold the entered values, then six integers to hold the ordered values, with if statements in between to work out the order of highest to lowest.

I tried to do the nested if’s but it got messy I decided to scrap it and start again.

I would appreciate any help with this.

Here is the kind of code I was writing:

  int one;
        int two;
        int three;
        int four;
        int five;
        int six;


        int firsthighest;
        int secondhighest;
        int thirdhighest;
        int fourthhighest;
        int fifthhighest;
        int sixthhighest;



        Console.WriteLine("Enter a value");
        one = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter a value");
        two = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter a value");
        three = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter a value");
        four = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter a value");
        five = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter a value");
        six = int.Parse(Console.ReadLine());



        if (one > two)
        {
            if (one > three)
            {
                if (one > four)
                {

                    if (one > five)
                    {

                        if (one > six)
                        {
                            firsthighest = one;

                        }

                    }

                }
            }

        }

        else if (two > three)
        {
            if (two > four)
            {

                if (two > five)
                {

                    if (two > six)
                    {
                        firsthighest = two;

                    }

                }

            }

        }

        else if (three > four)
        {


            if (three > five)
            {

                if (three > six)
                {
                    firsthighest = three;

                }

            }

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:38:46+00:00Added an answer on June 12, 2026 at 4:38 pm

    Is this homework?

    I’d suggest skipping the if’s and go right to your 2nd program – put all 6 in an array and sort it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a small program using CLR console application and when I write something
I am writing a console application using Visual Studio and C#. I am constantly
I am writing a small program in Visual Studio 11 (beta) that a console
I'm writing a small proof-of-concept console program with Visual Studio 2008 and I wanted
I'm writing small XMPP server using boost::asio and I want to unit-test my code.
I'm writing a small Windows application in Visual C++ without MVC. Its really small,
I am writing a small console application in C# that references a custom assembly
In a small console application I'm writing to test something I need to add
I'm writing a small program in C that will read input from the console.
I am writing small social application. One of the features is to write user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.