Amaliy topshiriq Quydagi Shart operatorlari bilan ishlash


Download 4.72 Mb.
Sana03.12.2023
Hajmi4.72 Mb.
#1801066
Bog'liq
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 "<cout<<"min element "<return 0;
}

#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 "<cout<<"min element "<return 0;
}


#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="<cout<<"y1="<}
else{
y1=x*y*2;
x1=(x+y)/2;
cout<<"y1="<cout<<"x1="<}

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=" <cout<<"x2=" <}
else if(d==0){
x1=-b/(2*a);
cout <<"x1=" <} else{
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=" <cout<<"n=" <}
else {
if(m>n){
n=m;
cout<cout<}else{
m=n;
cout<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= "<}else if(x<0){
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= "<}else if(a<=5){
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= "<}else if(sin(k)>0.2){
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= "<}else if(x<=0.3){
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