Answer the question
In order to leave comments, you need to log in
Plotting a function in C language?
Good afternoon, tell me how to plot a function graph as simply as possible using the C language?
#include <stdio.h>
#include <math.h>
int main()
{
float x, y, z, step;
printf("input x:\n");
scanf("%f", &x);
printf("Input y:\n");
scanf("%f", &y);
printf("input step:\n");
scanf("%f", &step);
printf("result:\n");
for(int i = 0; i < 32; i++)
{
z = (sin(x)+cos(y))/(cos(x)-sin(y))*tan(x*y);
printf("%.2f\t %f\n", x, z);
x += step;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question