fork download
  1. #include <stdio.h>
  2.  
  3.  
  4.  
  5. #include <stdio.h>
  6. #include<math.h>
  7.  
  8. int main() {
  9. setvbuf(stdout, NULL, _IONBF, 0);
  10. double a, b, c;
  11.  
  12.  
  13. printf("Enter the value:\n");
  14.  
  15. scanf("%lf %lf %lf", &a, &b, &c);
  16.  
  17. double root1, root2, discr;
  18.  
  19. discr = b*b - 4*a*c;
  20.  
  21. if(discr>=0){
  22.  
  23. root1 = (-b + sqrt(discr))/ 2*a;
  24. root2 = (-b - sqrt(discr))/ 2*a;
  25.  
  26. printf("The roots of the polynomials are %lf and %lf\n", root1, root2);
  27. }
  28.  
  29. else {
  30.  
  31.  
  32. printf("No real value\n");
  33.  
  34.  
  35. }
  36.  
  37.  
  38. int x; // seconds
  39. printf("Number of seconds after midnight:\n");
  40.  
  41. scanf("%i", &x);
  42.  
  43.  
  44.  
  45. int d, h, L, s;
  46.  
  47. d = (x- x % 86400)/86400 ;
  48.  
  49. h = (x % 86400 - (x % 86400)%3600)/3600;
  50.  
  51. L = ((x % 86400)%3600 - ((x % 86400)%3600%60))/60;
  52.  
  53. s = (x-d*86400-h*3600-L*60)%60;
  54.  
  55. printf("The exact time is %i %i %i %i", d, h, L, s );
  56.  
  57.  
  58.  
  59.  
  60. double m, n;
  61.  
  62. scanf("%lf", &m);
  63.  
  64. printf("The radian:");
  65.  
  66.  
  67. n = m-pow(m, 3)/6 + pow(m,5)/120 -pow(m,7)/5040 ;
  68.  
  69. printf("The Taylors series for value %lf is equal to %lf", m, n);
  70.  
  71.  
  72.  
  73.  
  74.  
  75. return 0;
  76. }
Success #stdin #stdout 0s 2156KB
stdin
1 -2 1

550

2

stdout
Enter the value:
The roots of the polynomials are 1.000000 and 1.000000
Number of seconds after midnight:
The exact time is 0 0 9 10The radian:The Taylors series for value 2.000000 is equal to 0.907937