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

  • SEARCH
  • Home
  • 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 6886533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:46:17+00:00 2026-05-27T05:46:17+00:00

couldn’t find similar posts, so posting my own question. I got variable array of

  • 0

couldn’t find similar posts, so posting my own question.
I got variable array of real:

price = array([58.9],[38.7],[8.95],[28.3])

I need to order it descending, with my code everything works well until last value of the array, I know even why, but can’t find solution on my own. Anyway here’s the code:

    Procedure orderarray;
Var i,dz, j: Integer;
  c  :real;
  v  :string[25];

Begin
dz := 1;
 For i := 1 to 3 do
  Begin
   For j:=i+1 to 4 do
    if price[j]>price[dz] //searches for highest value in the array
       then dz:=j;
   c:=price[i]; price[i] := price[dz]; price[dz] := c; //switches current value with highest
  End;
  • 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-05-27T05:46:17+00:00Added an answer on May 27, 2026 at 5:46 am

    I’ve found solution to my own problem. Posting it just in case anyone will need it. I needed to reset dz to i, not j

        Procedure orderarray;
    Var i,dz, j: Integer;
      c  :real;
      v  :string[25];
    
    Begin
     For i := 1 to 3 do
      Begin
    dz:=i;
       For j:=i+1 to 4 do
        if price[j]>price[dz] //searches for highest value in the array
           then dz:=j;
       c:=price[i]; price[i] := price[dz]; price[dz] := c; //switches current value with highest
      End;
    

    Thank you everybody for your help, wouldn’t get to the solution without you, anyway.

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

Sidebar

Related Questions

I couldn't find a straight answer to my question and need to know it
I couldn't find any useful information on Microsoft's site, so here is the question:
Couldn't find an answer to this question. It must be obvious, but still. I
I couldn't find any definitive answer to this question. I suppose most implementation use
Couldn't find better title but i need a Regex to extract link from sample
Couldn't find a function for this. I'm assuming I need to use regex? I'm
Couldn't find any real answers on google.
I couldn't find something similar in SO. In ASP.NET, is there any way that
Couldn't find any documentation about this: what is the order of execution of the
Couldn't find similar questions: I'm currently designing my app and after that I will

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.