Answer:
Please find the complete question in the attached file.
Explanation:
Following are the code to the given question:
-module(helloworld)//use a module
-export([start/0])
start() ->//start module
func([Head Taill) ->//defining a method func that takes a parameter
{
first, second} = Head,//holding head value
if //defining if block
first > second -> func(Tail)//method func that takes a parameter
true ->
[first, second}|func(Tail)]//method func that takes a parameter
end