Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Graph Drawing [8/9]

This exercise is very easy to solve if you follow the instructions. In this exercise, you don't need to analyze the given program in detail (but you can if you want to), and you don't have to be familiar with the mathematical concepts involved.

Run the given program first.

This program draws a graph of mathematical function x *x. Values of this function are calculated by expression x*x and stored in the variable fval. Find this expression in the source code of the program.

Exercise:

Make the program draw a graph of mathematical function

  • x + 2

Solution

#num fval = x + 2;

What happens when the variables x0 and y0 are initialized to some other values? Try it out.

Loading...