IV.Dastur tuzish
4.1 -misol. Quyida berilgan misollarni blok semasini va C++da dasturini tuzing
CHIZIQLI DASTUR TUZING VA NATIJASINI OLING;
7 вариант.
DASTUR
#include
#include
using namespace std;
int main()
{
int a,b,c,x;
cout<<"a=";
cin >> a;
cout<<"b=";
cin >> b;
cout<<"c=";
cin >> c;
cout<<"x=";
cin >> x;
double z= pow((a/pow(x,2)),(1/5))+pow(pow(c,2)/pow(b,2),(1/3))-(2*a*b+pow(c,2))/(pow((a+b),(1/3))-2*a*pow(b,2));
cout<<"z="<
return 0;
}
4.2 -misol. Quyida berilgan misollarni blok semasini va C++da dasturini tuzing
TARMOQLANUVCHI BLOK-SXEMA VA C++ DASTUR TUZING;
7 вариант.
DASTUR
#include
#include
using namespace std;
int main()
{
int x;
double y;
cout<<"x=";
cin >> x;
if (x<=2.6){
y=exp(1+abs(2.6+log(pow(x,3))));
}
else if (x>=6){
y=pow(sin((pow(x,(1/2))+(2.7/x))*(pow(x,(1/2))+(2.7/x))),3)+pow(cos(x),(1/2));
}
else{
y=pow(tan(pow(x,3)+3.5),2);
}
cout<<"y="<
return 0;
}
4.3 -misol. Quyida berilgan misollarni blok semasini va C++da dasturini tuzing
TAKRORLNUVCHI BLOK-SXEMA VA C++ DASTUR TUZING;
7 вариант.
DASTUR
#include
#include
using namespace std;
int main()
{
int b,c,x;
double s;
cout<<"b=";
cin >> b;
cout<<"c=";
cin >> c;
cout<<"x=";
cin >> x;
s=0;
for (int a=5; a<=8;a++){
s=s+((a*x+b*c)/(a*a+x));
}
cout<<"s="<
return 0;
}
DASTUR
#include
#include
using namespace std;
int main()
{
int a,b,c;
double p;
cout<<"b=";
cin >> b;
cout<<"c=";
cin >> c;
cout<<"a=";
cin >> a;
p=1;
for (int x=2; x<=5;x++){
p=p*((a+b*x)/(a*a+x*x));
}
cout<<"p="<
return 0;
}
DASTUR
#include
#include
using namespace std;
int main()
{
int b,x;
double p,sp;
cout<<"b=";
cin >> b;
cout<<"x=";
cin >> x;
sp=0;
for(int k=1; k<=4;k++){
p=1;
for (int a=2; a<=6;a++){
p=p*((a*k+b*x)/(k*k+x*x));
}
sp=sp+p;
}
cout<<"sp="<
return 0;
}
Do'stlaringiz bilan baham: |