Skip to content

Instantly share code, notes, and snippets.

@sushant12
Last active May 4, 2020 07:15
Show Gist options
  • Select an option

  • Save sushant12/7baa21c16bc190161a8c5b86631873c5 to your computer and use it in GitHub Desktop.

Select an option

Save sushant12/7baa21c16bc190161a8c5b86631873c5 to your computer and use it in GitHub Desktop.
implemented function to square and trebel a value
-module(first).
-export([double/1,mult/2,area/3,square/1,trebel/1]).
mult(X,Y) ->
X*Y.
double(X) ->
mult(2,X).
area(A,B,C) ->
S = (A+B+C)/2,
math:sqrt(S*(S-A)*(S-B)*(S-C)).
square(Num) ->
mult(Num, Num).
trebel(Num) ->
mult(3,Num).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment