two left
This commit is contained in:
27
labs/lab3_done/Sin/Program.cs
Normal file
27
labs/lab3_done/Sin/Program.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
public class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
double x, x1, x2, y;
|
||||
|
||||
Console.WriteLine("input x1:");
|
||||
x1 = double.Parse(Console.ReadLine());
|
||||
Console.WriteLine("input x2:");
|
||||
x2 = double.Parse(Console.ReadLine());
|
||||
|
||||
Console.WriteLine("x\t\t sin(x)");
|
||||
Console.WriteLine("--------------------------");
|
||||
|
||||
x = x1;
|
||||
do
|
||||
{
|
||||
y = Math.Sin(x);
|
||||
Console.WriteLine($"{x:F2}\t {y:F6}");
|
||||
x = x + 0.01;
|
||||
}
|
||||
while (x <= x2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user