| | |
Could you tell me how can I do this question?
Thread Solved
![]() |
First let's see the algorithm....
We need 3 variables for the 3 numbers,right?
We have to check the numbers one by one to see what is bigger or smaller...
And then,alert the user ....
We need 3 variables for the 3 numbers,right?
We have to check the numbers one by one to see what is bigger or smaller...
And then,alert the user ....
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
Delphi Syntax (Toggle Plain Text)
Program orders; {$APPTYPE CONSOLE} Uses SysUtils; Var a,b,c:Integer; Begin Write('a: '); {1.number} ReadLn(a); Write('b: '); {2.number} ReadLn(b); Write('c: '); {3.number} ReadLn(c); {check the numbers} If (a <= b) And (a < c) And (b <= c) Then WriteLn('Good Order!') Else WriteLn('Wrong Order!'); ReadLn; End. {Created by FlamingClaw 2009.06.06.}
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
delphi Syntax (Toggle Plain Text)
{ Thank you for your help and I was misunderstanding the question in before. I thought it ask me to swap the numbers if they are not in ascending numerical order. } Program Fixed_orders; {$APPTYPE CONSOLE} Uses SysUtils; Const minimum = 1; maximum = 3; Var MyArray:Array[minimum..maximum]Of Integer; MyI,MyK,MyT:Integer; Begin {get the 3 numbers from the user} For MyI:=minimum To maximum Do Begin Write(MyI,'. number is: '); ReadLn(MyArray[MyI]); End; {if needed exchange the order} For MyI:=minimum To maximum-1 Do Begin For MyK:=MyI+1 To maximum Do Begin If MyArray[MyK] < MyArray[MyI] Then Begin MyT:=MyArray[MyK]; MyArray[MyK]:=MyArray[MyI]; MyArray[MyI]:=MyT; End; End; End; WriteLn; WriteLn('The results are:'); {write the results} For MyI:=minimum To maximum Do Write(MyArray[MyI],','); ReadLn; End. {Created by FlamingClaw 2009.06.06}
Be a good part of the community.Don't be ungrateful.
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
If you ask something on the forum and you got the right answer then mark as solved!
If my opinion helped to you a lot then sometimes give reputation point to me.
I'm just a pascal programmer from Hungary.
Farewell...
![]() |
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: restricting decimal places on floating point values
- Next Thread: Please Translate C++ To Delphi
| Thread Tools | Search this Thread |





