Commit eb59b87c by matjul

Upload New File

parent df431ff2
Showing with 60 additions and 0 deletions
#include <stdio.h>
#include <math.h>
int main (){
float x;
float y;
int i;
int startV; //starting value of x
int stopV; //stopping value
int stepV; //a step value
int stepN; //number of steps
printf("Insert a starting value: ");
scanf("%d", &startV);
printf("Insert a stoping value: ");
scanf("%d", &stopV);
printf("Insert a step: ");
do
{
scanf("%d", &stepV);
if(stepV < 0){
printf("Step must be positive: ");
}
}
while(stepV < 0);
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 equal to 15: ");
}
}
while(stepN < 0 || stepN > 15);
printf("x\t ");
printf("y\n");
for(i = 0; i < stepN; i++){
for(x = startV + (i * stepV); x <= startV + (i * stepV); x++){
if(x <= stopV){
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