I-bob. C++ dasturlash tili haqida c++ dasturlash tili va tarixi 5


Download 0.78 Mb.
bet8/8
Sana24.03.2023
Hajmi0.78 Mb.
#1291022
1   2   3   4   5   6   7   8
Bog'liq
c tenglamalar 1

for(i=0;i{
for(j=i+1;j{
float f=mat[j][i]/mat[i][i];
for(k=0;k{
mat[j][k]=mat[j][k]-f*mat[i][k];
}
}
}
/* Backward substitution for discovering values of unknowns */
for(i=n-1;i>=0;i--)
{
res[i]=mat[i][n];
for(j=i+1;j{
if(i!=j)
{
res[i]=res[i]-mat[i][j]*res[j];
}
}
res[i]=res[i]/mat[i][i];
}
cout<<"\nThe values of unknowns for the above equations=>\n";
for(i=0;i{
cout<}
return 0;
}
kramer

3
4

5
6
7
8
9
10
11
12
13
14

int Kramera()
{
double matrix[3][2];
for (int i = 0; i < 2; ++i){
for (int j = 0; j < 3; ++j){
cin >> matrix[j][i];
}
}
double d = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
double d1 = matrix[2][0] * matrix[1][1] - matrix[2][1] * matrix[1][0];
double d2 = matrix[0][0] * matrix[2][1] - matrix[0][1] * matrix[2][0];
printf("%.3lf\n%.3lf\n", d1 / d, d2 / d);
system("pause");
}


Matritsa va O’rniga qo’yish usulida yechim

#include
#include
using namespace std;
int main(){
int a1,a2,a3,b1,b2,b3,c1,c2,c3,n,m,p;
float x1,x2,x3,x,y,z,A;
cout<<"diqqat !"<cout<<"tenglamalar sistemasi ko'rinishi.";
cout<cout<<"a1x1+a2x2+a3x3=n"<cout<<"b1x1+b2x2+b3x3=m"<cout<<"c1x1+c2x2+c3x3=p"<cout<cout<<"koeffitsiyentlarni kiriting ?"<cout<cout<<"a1="; cin>>a1;
cout<<"a2="; cin>>a2;
cout<<"a3="; cin>>a3;
cout<<"n="; cin>>n;
cout<cout<<"b1="; cin>>b1;
cout<<"b2="; cin>>b2;
cout<<"b3="; cin>>b3;
cout<<"m="; cin>>m;
cout<cout<<"c1="; cin>>c1;
cout<<"c2="; cin>>c2;
cout<<"c3="; cin>>c3;
cout<<"p="; cin>>p;
cout<cout<<"tenglamalar sistemasi ko'rinishi"<cout<"<x1=((a3*b2-b3*a2)*(p*a3-n*c3)-(m*a3-n*b3)*(a3*c2-c3*a2))/((a3*c1-c3*a1)*(a3*b2-b3*a2)-(a3*b1-b3*a1)*(a3*c2-c3*a2)); // <- x1
x2=((m*a3-n*b3)-x1*(a3*b1-b3*a1))/(a3*b2-b3*a2); // <- x2
x3=(n-a2*x2-a1*x1)/(a3); // <- x3
cout<<"x1="<cout<<"x2="<cout<<"x3="<

cout<
cout<<"Matritsa usulda yechim=>"<

A=a1*b2*c3+b1*a3*c2+a2*b3*c1-a3*b2*c1-a2*b1*c3-a1*b3*c2; // det(A)


x=n*b2*c3+a3*m*c2+a2*b3*p-a3*b2*p-a2*m*c3-n*b3*c2; // det(x)
y=a1*m*c3+a3*b1*p+n*b3*c1-a3*m*c1-n*b1*c3-a1*b3*p; // det(y)
z=a1*b2*p+n*b1*c2+a2*m*c1-n*b2*c1-a2*b1*p-a1*m*c2; // det(z)

x1=x/A; cout<<"x1="<
x2=y/A; cout<<"x2="<x3=z/A; cout<<"x3="<}

XULОSA


Xulosa qilib shuni aytish mumkinki,c++ dasturlash tilida tenglamalar sistemasini yechishda bir nechta uslubiyatlar ko’rsatib o’tildi. Masalan: o’rniga qo’yish uslubiyati, Gauss Jordan,Kramer,matritsa uslubiyati ko’rsatib o’tildi.
c++ tilining grafik imkoniyatlariga oid misollar yechildi. Funksiyalarni qo’llash bo’yicha bilim, ko’nikma va malakalarni shakllantirildi.

ADABIYOTLAR RO’YXATI


1. Sh.M. Mirziyoyev. “Erkin va farovon, demokratik O‘zbekiston davlatini birgalikda barpo etamiz”.-Toshkent: O‘zbekiston, 2016. – 56 b.
2. Sh.M. Mirziyoyev. “Tanqidiy tahlil, qatʼiy tartib-intizom va shaxsiy javobgarlik— har bir rahbar faoliyatining kundalik qoidasi bo‘lishi kerak”.- Toshkent: O‘zbekiston, 2017. – 104 b.
3. Sh.M.Mirziyoyev. “Buyuk kelajagimizni mard va oliyjanob xalqimiz bilan quraylik”. Toshkent: O’zbekiston, 2017. – 488 b.
4. Sh.A.Nazirov “ C va C++tili “ Toshkent 2013
5. Sh.F.Madraximov “ C++tilida pragrammalash boyicha masalalar toplami (oquv qollanma) “ Toshkent 2013
6.SH.F.Madraximov “ c++ tilida programmalash asoslari ” Toshkent 2009
7.www.ziyonet.uz – Axborot ta‘lim portali
Internet resurslari
www.google.com
www.w3schools.com
www.geeksforgeeks.org
www.cpp.sh
www.kutubxona.uz
www.youtube.com
www.ok.ru
www.cplyusplyus.com

Download 0.78 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling