Berilgan vazifalar.
C++ algoritmik chiziqli jarayonlarini dasturlash.
Boshlash
x, y
y
Tamom
|
// Algoritmni boshlash
// O’zgaruvchilarni kiritish
// Hisoblash
// Natijani chop etish
// Tamom
|
Dasturi:
#include
#include
Using namespace std;
int main()
{
Int x, y; float a;
cout<<”X= “; cin>>x;
cout<<”Y=”; cin>>y;
a = (1+pow(x,2))*x + (exp(x)/(2*pow(x,2)+5)) – x/(y*pow(cos(x),3));
cout<<”a=”<return 0;
}
Natija:
C++ algoritmik tilida tarmolanuvchi jarayonlarni dasturlash.
y
Bosh
Tamom
y
x>4
Dasturi:
#include
#include
using namespace std;
int main()
{
Float x, y;
Cout<<”X=”; cin>>x;
If(x>4)
Y=pow(x,2) – 19*x – 69;
Else
Y= 3/(pow(x,2) – 19*x – 69 );
Cout<<”Y=’’<
Return 0;
}
Natija:
C++ algoritmik tilida takrorlanuvchi jarayonlarni dasturlash.
#include
#include
Using namespace std;
int main()
{
Float x, y;
For (x=0 ; x<=2 ; x+=0.1) {
Y= pow(log(srt(pow(x,2))),3) + 4*x +2;
Cout<<”x=”<
Return 0;
}
Natija:
#include
#include
Using namespace std;
int main()
{
Float n, Sum = 0;
For(n=1 ; n<=15 ; n++){
Sum += 13/(pow(n,3) + 5*n + 7);
Cout<<”N=”<
}
Cout <<”all sum=”
Return 0;
}
Natija:
Bajardi: Sagdullayev I.N.
Do'stlaringiz bilan baham: |