Commit dc7bde6d by muhega

Upload New File

parent 628e1dd7
Showing with 45 additions and 0 deletions
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float Y,YM,A,H,i=0,X;
printf("enter the starting value\n");
scanf("%f",&A);
printf("enter the lower limit of function value\n");
scanf("%f",&YM);
printf("enter the step value it must be greater than 0 \n");
scanf("%f",&H);
while(H<1)
{
printf("wrong number please enter a number greater than 0 \n");
scanf("%f",&H);
}
while(i<15)
{
X=A+i*H;
Y=(pow(X,3)+2*X-14)/(7*X);
if (Y<YM)
{
printf("function has exceeded it's lower limit\n");
return 0;
}
if (i==0)
{
printf("the Results are:\n");
printf("X \t f(X)\n");
}
if (Y==-INFINITY|| Y==INFINITY )
{
printf("%.2f \t not available",X);
}
else
{
printf("%.2f \t %.2f\n",X,Y);
}
i++;
}
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