112-guruh
To
’
xtayev Aminjonning dasturlash laboratoriyadan bajargan 3-mashg
’
uloti.
3-misol.
#include
using namespace std;
void Swap1(float x,float y){
float z;
z=x+y;
x=z-x;
y=z-y;
}
int main(){
float a,b,c,d;
cout<<" a=";cin>>a;
cout<<" b=";cin>>b;
cout<<" c=";cin>>c;
cout<<" d=";cin>>d;
Swap1(a,b);
Swap1(b,c);
Swap1(c,d);
cout<<" Swap funksiyadan so'ng :"<
cout<<" a="< cout<<" b="<
cout<<" c="<
cout<<" d="<
}
1-misol.
#include
using namespace std;
int main(){
int n; cin>>n;
int X[n];
for(int i=0;i
cin>>X[i];
}
int max=X[0];
int min=X[0];
for(int i=1;i
if(max
max=X[i];
}
if(min>X[i]){
min=X[i];
}
}
int s=0;
int m=max-min;
for(int i=0;i
if(X[i]
s+=X[i];
}
}
cout<
}