tanlash operatori bo’yicha topshiriqar (switch, case,break,default)
#include
using namespace std;
int main(){
float a,b,c,x,y;
int n;
cout<<"x = ";
cin>>x;
cout<<"Case :";
cin>>n;
switch (n)
{
case 1:
a=3.2, b=-0.7, c=2.2;
break;
case 2:
a=10.5, b=-2.5, c=5.6;
break;
case 3:
a=5.4, b=3, c=2.6;
break;
default:
cout<<"Bunday case yuq";
break;
}
if(abs(1-x*x)==a+c){
y=x*exp(a)+exp(abs(b*c));
}
else if(abs(1-x*x)>a+c){
y=pow(sin(a*x),2)+cos(b*c);
}
else if(abs(1-x*x)>a+c){
y=pow((a*pow(b,4)+pow((c*x*x),1./5)),1./2);
}
cout<<"y="<}
2.(for, while, do while) operatorlari bo’yicha topshiriqar
3.Funksiyalar (masalala funksiya bo‘yicha yechish) funksiya bo’yicha
topshiriqar
Do'stlaringiz bilan baham: |