Write a function subprogram perfun that accepts two double precision arguments x and p and returns the value of the function at the point x. If the input value lies between 0≤ x < p then you can return any interesting wave shape, such as a sawtooth or a cardiogram. (Make sure that your wave shape is not left-right symmetric and don't use trigonometric functions.) For values of x outside this range, have the function call itself, but at an argument translated by ±p.
The main program should ask the user to enter two numbers a and b and then print out a table of values of x and perfun(x,p) for about 30 equally spaced points from a to b. (e,g., try a=-2p and b=4p.)