Amaliy topshiriq Quydagi Shart operatorlari bilan ishlash
Download 4.72 Mb.
|
Amaliy topshiriq
Amaliy topshiriq Quydagi Shart operatorlari bilan ishlash mavzusiga oid topshiriqlarni talabalar barchasini bajarishi kerak. #include #include using namespace std; int main() { int x,y; cout<<"x= ";cin>>x; cout<<"y= ";cin>>y; cout<<"max element "< } #include #include using namespace std; int main() { int x,y,z; cout<<"x= ";cin>>x; cout<<"y= ";cin>>y; cout<<"z= ";cin>>z; cout<<"max element "< } #include #include using namespace std; int main() { int x,y; cout<<"x= ";cin>>x; cout<<"y= ";cin>>y; if(x>y){ cout< else{ cout< return 0; } #include #include using namespace std; int main () { double x,y,x1,y1; cout<<"x= ";cin>>x; cout<<"y= ";cin>>y; if(x>y){ x1=x*y*2; y1=(x+y)/2; cout<<"x1="< else{ y1=x*y*2; x1=(x+y)/2; cout<<"y1="< return 0; } #include #include using namespace std; int main () { double a,b,c,d,x1,x2; cout<<"a= ";cin>>a; cout<<"b= ";cin>>b; cout<<"c= ";cin>>c; d=b*b-4*a*c; if(d>0){ x1=(-b-sqrt(d))/(2*a); x2=(-b+sqrt(d))/(2*a); cout <<"x1=" < else if(d==0){ x1=-b/(2*a); cout <<"x1=" < cout<<"yechimga ega emas"; } return 0; } #include #include using namespace std; int main () { double m,n; cout<<"m= ";cin>>m; cout<<"n= ";cin>>n; if(m==n){ m=0; n=0; cout <<"m=" < else { if(m>n){ n=m; cout< m=n; cout< } return 0; } #include #include using namespace std; int main () { int a; cout<<"sonni kiriting ";cin>>a; if(a==1){ cout<<"dekabr yanvar fevral "; } if(a==2){ cout<<"mart aprel may "; } if(a==3){ cout<<"iyun iyul avgust "; } if(a==4){ cout<<"sentabr oktabr noyabr "; } return 0; } #include #include using namespace std; int main () { double a; cout<<"a ni kiriting ";cin>>a; cout<cout<cout<cout<cout<return 0; } #include #include using namespace std; int main () { int a; cout<<"sonni kiriting ";cin>>a; if(a==1){ cout<<"4 soat"; } if(a==2){ cout<<"5 soat"; } if(a==3){ cout<<"2 soat"; } if(a==4){ cout<<"3 soat"; } if(a==5){ cout<<"1 soat"; } if(a==6){ cout<<"6 soat"; } if(a==7){ cout<<" 1 soat"; } return 0; } #include #include using namespace std; int main() { float x,z; cout<<"x= ";cin>>x; if(x>3){ z=sqrt(fabs(x/(x+1))-sqrt(x)); cout< else if(x<=3){ z=pow((log(fabs(x))/x),3); cout< return 0; } #include #include using namespace std; int main() { double x,z; cout<<"x= ";cin>>x; if(x>=0){ z=x*exp(x)*sin(x); cout< else if(x<0){ z=(1.0/3.0)*pow(log(abs(x)),3); cout< return 0; } #include #include using namespace std; int main () { double x,y; cout<<"x= ";cin>>x; if(x>=0){ y=log(x+sqrt(x*x+9)); cout<<"y= "< y=pow(tan(x),3); cout<<"y= "< return 0; } #include #include using namespace std; int main () { double x,y,a; cout<<"x= ";cin>>x; cout<<"a= ";cin>>a; if(a>5){ y=a/(a*a+x); cout<<"y= "< y=1/(2*a*a*a+sin(a)); cout<<"y= "< return 0; } #include #include using namespace std; int main () { double k,y; cout<<"k= ";cin>>k; if(sin(k)<=0.2){ y=sqrt(k); cout<<"y= "< y=1/sqrt(k); cout<<"y= "< return 0; } #include #include using namespace std; int main () { double x,y; cout<<"x= ";cin>>x; if(x>0){ y=pow(sin(2*x),2)-pow(cos(x),2); cout<<"y= "< y=1/(x*x*-sqrt(x)); cout<<"y= "< return 0; } Download 4.72 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling