Find the biggest and smalles of A,B,C by algorithm
Solved/Closed
YemenSEF
Posts
2
Registration date
Monday November 26, 2012
Status
Member
Last seen
August 19, 2013
-
Nov 26, 2012 at 06:23 AM
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 - Nov 29, 2012 at 01:19 PM
Zohaib R Posts 2368 Registration date Sunday September 23, 2012 Status Member Last seen December 13, 2018 - Nov 29, 2012 at 01:19 PM
Related:
- Find the biggest and smalles of A,B,C by algorithm
- Des algorithm in cryptography - Guide
- Apple music algorithm - Home - Apps & Sites
- Instagram algorithm: 2022, change, for reels, posts - Guide
3 responses
Zohaib R
Posts
2368
Registration date
Sunday September 23, 2012
Status
Member
Last seen
December 13, 2018
69
Nov 26, 2012 at 02:39 PM
Nov 26, 2012 at 02:39 PM
Hi YemenSEF,
You can try the below mentioned algorithm:
largest = x
smallest = x
if (y > largest) then largest = y
if (z > largest) then largest = z
if (y < smallest) then smallest = y
if (z < smallest) then smallest = z
If you want to write the same in any programming language do reply.
Please revert for clarification.
You can try the below mentioned algorithm:
largest = x
smallest = x
if (y > largest) then largest = y
if (z > largest) then largest = z
if (y < smallest) then smallest = y
if (z < smallest) then smallest = z
If you want to write the same in any programming language do reply.
Please revert for clarification.
Zohaib R
Posts
2368
Registration date
Sunday September 23, 2012
Status
Member
Last seen
December 13, 2018
69
Nov 29, 2012 at 01:19 PM
Nov 29, 2012 at 01:19 PM
Hi YemenSEF,
I appreciate your hard work. Yes, your algorithm will give you the right results. Feel free to approach if you need any further help.
I appreciate your hard work. Yes, your algorithm will give you the right results. Feel free to approach if you need any further help.
YemenSEF
Posts
2
Registration date
Monday November 26, 2012
Status
Member
Last seen
August 19, 2013
Nov 27, 2012 at 05:46 PM
Nov 27, 2012 at 05:46 PM
Thanks very much
but i have already tried alot and found a good answer andi hope its right too
I did one like this
-start
-read ,a,b,c
-IF A>B then
A = larg
B = smal
Else
A=smal
B=larg
-IF C>larg then C=larg
-IF C<smal then C=smal
-Print: smal"Is the smallest" , larg "Is the largest"
-end
but i have already tried alot and found a good answer andi hope its right too
I did one like this
-start
-read ,a,b,c
-IF A>B then
A = larg
B = smal
Else
A=smal
B=larg
-IF C>larg then C=larg
-IF C<smal then C=smal
-Print: smal"Is the smallest" , larg "Is the largest"
-end