Commit 3dd5a3a0 by matjul

Upload New File

parent 4ac636d0
Showing with 49 additions and 0 deletions
#include <stdio.h>
#include <math.h>
int main () {
float x;
float y;
int i;
float startV; //starting value of x
float stopV; //stopping value
float stepV; //a value of step that is calculated afer all inputs
int stepN; //number of steps
printf("Insert a starting value: ");
scanf("%f", &startV);
printf("Insert a stoping value: ");
scanf("%f", &stopV);
printf("Insert a number of steps: ");
do
{
scanf("%d", &stepN);
if(stepN < 0){
printf("Number of steps must be positive: ");
}
if(stepN > 15){
printf("Number of steps must be less or equals to 15: ");
}
}
while(stepN < 0 || stepN > 15);
printf("x\t ");
printf("y\n");
stepV = (stopV - startV) / (stepN - 1);
for(i = 0; i < stepN; i++){
for(x = (stepV * i) + startV; x <= (stepV * i) + startV; x++){
if(4 - pow (x, 2) == 0){
printf("%f\tnot defined\n", x);
}else{
y = (sqrt(pow (x, 3) + (4 * pow (x, 2))) / (4 - (pow (x, 2))));
printf("%f\t%f\n", x, y);
}
}
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment