From Wikipedia, the free encyclopedia
Este artigo ilustra algúns exemplos en varias linguaxes de programación para ilustrar a sintaxe de cada unha. O algoritmo implementado é simplemente facer a suma entre dous valores.
int SumaDeDousValores (int A, int B)
{
return ( A + B );
}
function SumaDeDousValoresEnteiros(a as integer, b as integer) as integer
SumaDeDousValores=a+b
end function
function SumaDeDousValoresInteiros( A, B: Integer ): Integer;
var Resultado : Integer;
begin
Resultado := A + B;
SumaDeDousValoresInteiros := Resultado;
end;
function SumaDeDousValores( A, B: Integer ): Integer;
begin
Result := A + B;
end;
def SumaDeDousValores (a, b):
return a + b
(define Suma (lambda (x y) (+ x y)) )
suma :: Integer -> Integer -> Integer -- (asinatura) suma a b = a + b
defina "SumaDeDousValores [[a b]] [escriba suma :a :b]]
function sumaDeDousValores (a, b){
trace(a + b);
};
function SumaDeDousValores($VlrA, $VlrB)
{
return ($VlrA + $VlrB);
}
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.