Muahmmad al-Xorazimiy nomidagi Toshkent Axborot Texnologiyalari Universtiteti 1-kurs talabasi
Sultonov Hayotjonning Dasturlash 1 dan bajargan ishi.
1-ish
1.
ctg(x/3)+sin(x)
π/4
π/2
10
Kod qism:
#include
using namespace std;
int main(){
float fx,x0=M_PI/4,xn=M_PI/2,h,x=x0; int m=10;
h=(xn-x0)/m;
while(x<=xn){
fx=1/tan(x/3)+sin(x);
x+=h;//o’sib borish tartibi
cout<<"f("<}
}
2-Ish
19.
a)
=
+
+
9
1
2
3
19
n
n
n
n
;
b)
=
-
+
+
+
9
3
1
3
2
)
3
(
t
t
e
t
t
t
tg
;
c)
(
)
(
)
-
=
=
+
+
0
4
19
2
i
m
i
m
i
m
i
Kod qism:
#include
using namespace std;
int main(){
char input;
double summa=0.0;
cin>>input;// kiritish operatori bu yoqda character uchun qiymatni kiritib o'tamiz
switch(input){
case 'a':{ //a belgingan paytdagi qiymat
for(int i=1;i<=9;i++){
summa+=19.0*i/(3+i+i*i);
cout<<"summa "<}
break;
}
case 'b':{ //b belgilangan paytdagi qiymat
for(int i=3;i<=9;i++){
summa+=tan(i+3)/(pow(i,3)+2*i+exp(i-1));
cout<<"Summa:"<}
break;
}
case 'c':{// c ishlangan paytdagi qitymatlar
double fact1=1.0,fact2=1.0,fact3;
for(int i=-4;i<=0;i++){
for(int m=2;m<=19;m++){
fact1*=(pow(i,1/i)+m)/(i+m);
}
fact2*=fact1;
cout<}
break;
}default :cout<<"hato char kiritdingiz";
}
main();//funksiyani qayta ishlash uchun
system("pause");
}
3-Ish
19.
( )
2
2
1
...
!
!
n
x
x
s
n
= +
+ +
0,1
1
x
2
x
y е
=
20
Kod qism:
#include
using namespace std;
double fact(double p){ //bu yoqda ishni osonlashtirish maqsadida o'zim uchun bitta funksiya e'lon qilib olldim
double t=1;
for(int q=1;q<=p;q++){
t*=q;
}
return t;
}
int main(){
double x0,xn,y,h,x=0,Summa=0.0; int N=20;x0=0.1;
int n=-1;
xn=1;
h=(xn-x0)/N;
while(x<=xn){
y=exp(x/2);
n+=1;
Summa+=pow(2*x,n)/fact(n);
cout<cout<<"Summa="<x+=h;
}
}
|