Advertisement
Batisk_AFF

tail-4

Oct 16th, 2020 (edited)
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static double f(double x)
  12.         {
  13.             return ((2*0.01*Math.Log(x))/(x));
  14.         }
  15.  
  16.         static double g(double x)
  17.         {
  18.             return (x/(x*x - 4*x + 5));
  19.         }
  20.  
  21.         static void Main(string[] args)
  22.         {
  23.             Console.Write("a = ");
  24.             double a = Double.Parse(Console.ReadLine());
  25.             Console.Write("b = ");
  26.             double b = Double.Parse(Console.ReadLine());
  27.             Console.Write("h = ");
  28.             double h = Double.Parse(Console.ReadLine());
  29.             Console.WriteLine("\nProgram output:\nx\tf(x)\t\t\tg(x)");
  30.             for (double i = a; i <= b; i += h)
  31.             {
  32.                 Console.WriteLine("{0}\t{1}\t{2}", i, f(i), g(i));
  33.             }
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement