Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. /*=======================================================*/
  2. int main(void)
  3. {
  4.  
  5. int coefficients[] = {0};
  6. int x_endpoints [] = {0};
  7. int tolerances [] = {0};
  8.  
  9.  
  10. /*== Initial prompt ==*/
  11. printf("\n");
  12. printf (" Root search results \n");
  13. printf (" =========================================\n\n");
  14.  
  15. printf("Welcome! The purpose of this program is to use \n");
  16. printf("the bisection method, an algorithm for\n");
  17. printf("approximating the root of a continuous function,\n");
  18. printf("to find an approximate root for an equation with\n");
  19. printf("the form f(x)= a*x*ln(|x| + 0.5) + b*x + c.\n\n");
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. /* Exit the program */
  28. printf("Have a nice day!\n");
  29. return 0;
  30. }
  31.  
  32.  
  33. /**************************************************************
  34. * Function read_input: a function to read all 7 inputs
  35. * Input:
  36. *
  37. *
  38. * Output:
  39. * Echos the inputs (by calling one of
  40. * functions below.
  41. *
  42. ***************************************************************/
  43.  
  44. void read_input(double *coeff, double *xep, double *tole)
  45. {
  46. scanf("%lf %lf %lf %lf %lf %lf %lf",&coeff[0],&coeff[1],&coeff[2],&xep[0],&xep[1],&tole[0],&tole[1]);
  47. }
  48. echo_inputs(coeff,xep,tole);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement