Use shift-enter to make new line.
functionname := proc() local a; a := 1/2; evalf(a/2); end proc;
to see build in procedure use, for example to see build in least common multiple (lcm) use the follow command:
> interface(verboseproc = 2): > print(lcm);
- Assign the integers 12321, 23432, and 34543 to the names a, b, and c. Use these names to find the sum and difference of each pair of numbers.
ex1 := proc() local a, b, c, sum; a := 12321: b := 23432: c := 34543: sum := a + b + c; end proc:
- Write two procedures. The first requires two inputs and finds their sum. The second requires two inputs and finds their product. Use these procedures to add and multiply pairs of numbers. How could you use these procedures to add and multiply three numbers?
ex21 := proc(a,b) local sum; sum := a+b; end proc: