fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main() {
  4. float a=0.4;
  5. float b=1;
  6. float h=0.05;
  7. float x,y;
  8. int n, i;
  9.  
  10. n = ((b - a) / h) + 1 ;
  11. printf("Табулирование функции (y = 2x sin x - cos x) \n");
  12. scanf("%if", y);
  13.  
  14. for (i=0; i < n; i++) {
  15. x=a + i * h;
  16. y = 2 * x * sin (x) - cos (x);
  17. printf("%.2f\t%7.4f\n", x, y);
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
Табулирование функции (y = 2x sin x - cos x) 
0.40	-0.6095
0.45	-0.5090
0.50	-0.3982
0.55	-0.2776
0.60	-0.1478
0.65	-0.0093
0.70	 0.1371
0.75	 0.2908
0.80	 0.4511
0.85	 0.6172
0.90	 0.7884
0.95	 0.9638
1.00	 1.1426