Deponentlanadigan materiallarning titul varag‘i
EHM uchun dastur (Ma’lumotlar bazasi) nomi:
“EHM uchun dastur yoki ma’lumotlar bazasining nomi iloji boricha o‘zbek yoki rus tilida taqdim etiladi.”
Huquq ega(lar)si :
Ismoilova Dilrabo
_________________________________________________________
_________________________________________________________
_________________________________________________________
Muallif(lar):
ORIPJONOV SANJARBEK SALIMJON O‘G‘LI
_________________________________________________________
_________________________________________________________
_________________________________________________________
EHM uchun dasturni identifikatsiya qiluvchi materiallar dastlabki matni (Dastur kodi)
using System;
namespace Misol_3
{
class Program
{
static double Y(double x)
{
return (x - 1) * Math.Log10(x)/Math.Log10(Math.Exp(x)) - 1;
}
static double YI(double x)
{
return Math.Log10(x)/Math.Log10(Math.Exp(x)) + (x + 1) / x;
}
static double YII(double x)
{
return (1 / x) + (1/(x * x));
}
static double Xna(double xn, double b)
{
return xn - Y(xn) * (b - xn) / (Y(b) - Y(xn));
}
static double Xnb(double xn, double a)
{
return xn - Y(xn) * (xn - a) / (Y(xn) - Y(a));
}
static void Main(string[] args)
{
double a = 2;
double b = 3;
double eps = 0.02;
double x0 = 0, x = 0;
int qadamlar = 0;
if (YI(a) * YII(a) > 0)
{
x0 = a;
while (true)
{
x = Xna(x0, b);
if (Math.Abs(x - x0) < eps)
{
break;
}
qadamlar++;
x0 = x;
}
}
else
{
x0 = b;
while (true)
{
x = Xnb(x0, a);
if (Math.Abs(x - x0) < eps)
{
break;
}
qadamlar++;
x0 = x;
}
}
Console.WriteLine("Tenglama yechimi:\t" + x);
Console.WriteLine("Qadamlar soni:\t" + qadamlar);
Console.ReadKey(true);
}
}
}
Do'stlaringiz bilan baham: |