MUSTAQIL ISH
Mavzu: C# dasturlash tilida Math kutubxonasidan foydalanish
Topshiriq: Quyidagi matematik funksiyalarni C# dasturlash tili orqali dasturini yarating.
Berilganlar: a = 1.1, b = 0.004, x = 0.2
Ifoda: y = sin²(a · x) + b · cos³(x)
using System;
using static System.Math;
class HelloWorld {
static void Main() {
double a = 1.1, b = 0.004, x = 0.2;
double y = Pow(Sin(a * x), 2) + b * Pow(Cos(x), 3);
Console.WriteLine("y = " + y);
}
}
Topshiriq: Quyidagi matematik funksiyalarni C# dasturlash tili orqali dasturini yarating.
Berilganlar: m = 2, c = -1, t = 1.2, b = 0.7
Ifoda: y = (sqrt(|m · t + c|) + b) / (sin²(t) + c)
using System;
using static System.Math;
class HelloWorld {
static void Main() {
double m = 2, c = -1, t = 1.2, b = 0.7;
double y = (Sqrt(Abs(m * t + c)) + b) / (Pow(Sin(t), 2) + c);
Console.WriteLine("y = " + y);
}
}
Topshiriq: Quyidagi matematik funksiyalarni C# dasturlash tili orqali dasturini yarating.
Berilganlar: a = 3.2, b = 17.5, x = -4.8
Ifoda: y = sqrt(|a · x + b|) / (x² + 1)
using System;
using static System.Math;
class HelloWorld {
static void Main() {
double a = 3.2, b = 17.5, x = -4.8;
double y = Sqrt(Abs(a * x + b)) / (Pow(x, 2) + 1);
Console.WriteLine("y = " + y);
}
}
Topshiriq: Quyidagi matematik funksiyalarni C# dasturlash tili orqali dasturini yarating.
Berilganlar: x = 1.4, y = -1.2, z = 3.05
Ifoda: t = ((2 · cos(x - π/6)) / (0.5 + sin²(y))) · (1 + z² / (3 - z² / 5))
using System;
using static System.Math;
class HelloWorld {
static void Main() {
double x = 1.4, y = -1.2, z = 3.05;
double t = ((2 * Cos(x - PI / 6)) / (0.5 + Pow(Sin(y), 2))) * (1 + Pow(z, 2) / (3 - Pow(z, 2) / 5));
Console.WriteLine("t = " + t);
}
}
Topshiriq: Quyidagi matematik funksiyalarni C# dasturlash tili orqali dasturini yarating.
Berilganlar: x = 1.8, y = 18.2, z = -3.02
Ifoda: u = (|x - y| + z²) / (x² + y² + 1)
using System;
using static System.Math;
class HelloWorld {
static void Main() {
double x = 1.8, y = 18.2, z = -3.02;
double u = (Abs(x - y) + Pow(z, 2)) / (Pow(x, 2) + Pow(y, 2) + 1);
Console.WriteLine("u = " + u);
}
}