Oʻzbekiston respublikasi oliy ta’lim, fan va innovatsiyalar vazirligi

|
Oʻzbekiston respublikasi oliy ta’lim, fan va innovatsiyalar vazirligi
|
bet | 1/10 | Sana | 04.12.2023 | Hajmi | 0,71 Mb. | | #110600 |
OʻZBEKISTON RESPUBLIKASI OLIY TA’LIM, FAN VA INNOVATSIYALAR VAZIRLIGI MUHAMMAD AL-XOZAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
AMALIY ISH
_PRG004-3______ guruh talabasi
Fan : Dasturlash-1
Bajardi: Jumayev Jalol
Tekshirdi: Qodirov Zarif Zafarovich
TOSHKENT – 2023
Begin(1-40) To'rtburchakning a va b tomonlari berilgan. Uning maydoni S = a∗b va perimetri P=2∗(a+b) topilsin.
#include
using namespace std;
int main()
{
float a,b;
cout << "a=";
cin >> a;
cout << "b=";
cin >> b;
float s = a*b;
cout << "s=" << s << endl;
float p = 2*(a+b);
cout << "p=" << p << endl;
return 0;
}
2. Kvadratning tomoni berilgan a . Uning maydonini toping S = a² .
#include
using namespace std;
int main()
{
float a;
cout << "a=";
cin >> a;
float S = a*a;
cout << "S=" << S;
return 0;
}
3.To'rtburchakning a va b tomonlari berilgan. Uning maydoni S = a∗b va perimetri P=2∗(a+b) topilsin.
#include
using namespace std;
int main()
{
float a,b;
cout << "a=";
cin >> a;
cout << "b=";
cin >> b;
float s = a*b;
cout << "s=" << s << endl;
float p = 2*(a+b);
cout << "p=" << p << endl;
return 0;
}
4. Aylana diametri berilgan d. Uning uzunligini L=p∗d toping. p qiymati sifatida 3.14 dan foydalaning.
#include
int main(void)
{
float d;
printf("d:");
scanf ("%f", &d);
float L= 3.14*d;
printf("L:%f\n",L);
return 0;
}
5.Kub chetining uzunligi berilgan a. V=a 3 kub hajmini va uning sirt maydoni S=6∗a² ni toping
#include
int main(void)
{
float a;
printf("a:");
scanf ("%f", &a);
float V= a*a*a;
printf("V:%f\n",V);
float S= 6*a*a;
printf("S:%f\n",S);
return 0;
}
6. To'g'ri burchakli parallelepipedning a, b, c qirralarining uzunliklari berilgan. Uning hajmini V=a∗b∗c va sirt maydoni S=2∗(a∗b+b∗c+a∗c) toping.
#include
int main(void)
{
float a,b ,c;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("c:");
scanf ("%f", &c);
float V= a*b*c;
printf("V:%f\n",V);
float S= 2*(a*b+b*c+a*c);
printf("S:%f\n",S);
return 0;
}
7. Berilgan R radiusli aylana L va S aylana yuzini toping:
L=2∗p∗R, S=p∗R 2 . p
#include
int main(void)
{
float R;
printf("R:");
scanf ("%f", &R);
float L= 2*3.14*R;
printf("V:%f\n",L);
float S= 3.14*R*R;
printf("S:%f\n",S);
return 0;
}
qiymati sifatida 3.14 dan foydalaning.
8. Ikkita a va b raqamlari berilgan. Ularning o‘rtacha arifmetik qiymatini toping: (a+b)/2.
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("%f\n",(a+b)/2);
return 0;
}.
8.
Ikki manfiy bo'lmagan a va b sonlar berilgan. Ularning geometrik o'rtasini, ya'ni ko'paytmasining kvadrat
#include
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("%f\n",sqrt(a*b));
return 0;
}
ildizini toping: √a b
9. Ikki manfiy bo'lmagan a va b sonlar berilgan. Ularning geometrik o'rtasini, ya'ni ko'paytmasining kvadrat
#include
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("%f\n",sqrt(a*b));
return 0;
}
ildizini toping: √a b
Nolga teng bo'lmagan ikkita raqam berilgan. Ularning kvadratlari yig‘indisini, ayirmasini, ko‘paytmasini va qismini toping.
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("%f\n",a*a+b*b);
printf("%f\n",a*a-b*b);
printf("%f\n",a*a*b*b);
printf("%f\n",(a*a)/(b*b));
return 0;
}
11. Nolga teng bo'lmagan ikkita raqam berilgan. Ularning modullarining yig‘indisini, ayirmasini, mahsulotini va qismini toping.
#include
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
printf("%f\n",abs(a)+abs(b));
printf("%f\n",abs(a)-abs(b));
printf("%f\n",abs(a)*abs(b));
printf("%f\n",abs(a)/abs(b));
return 0;
12.
To'g'ri burchakli uchburchakning a va b oyoqlari berilgan. Uning c gipotenuzasi va P perimetrini toping:
√a²+b², P=a+b+c.
#include
#include
int main(void)
{
float a, b;
printf("a:");
scanf ("%f", &a);
printf("b:");
scanf ("%f", &b);
float c = sqrt(pow(a,2)+pow(b,2));
printf("c:%f\n",c);
float P = a+b+c;
printf("P:%f\n",P);
return 0;
}
13. Umumiy markaz va radiuslari R 1 va R 2 (R 1 >R 2 ) bo‘lgan ikkita aylana berilgan. Bu doiralarning S 1 va S 2 maydonlarini , shuningdek , tashqi radiusi R 1 ga, ichki radiusi esa R 2 ga teng bo‘lgan halqaning S 3 maydonini toping : S
#include
#include
int main(void)
{
float R1, R2;
printf("R1:");
scanf ("%f", &R1);
printf("R2:");
scanf ("%f", &R2);
float S1 = 3.14*pow(R1,2);
printf("S1:%f\n",S1);
float S2 = 3.14*pow(R2,2);
printf("S2:%f\n",S2);
float S3=S1-S2;
printf("S3:%f\n",S3);
return 0;
}
1 =p (R 1) ) 2 , S2 = p (R 2 ) 2 , S 3 =S 1 -S 2 .
14. Doira uzunligi L berilgan. L=2∗p∗R, S=p∗R 2 ekanligini hisobga olib, uning R radiusini va shu aylana bilan chegaralangan aylananing S maydonini toping . p qiymati sifatida 3.14 dan foydalaning.
#include
#include
int main(void)
{
float L;
printf("L:");
scanf ("%f", &L);
float R = L/(2*3.14);
printf("R:%f\n",R);
float S = 3.14*pow(R,2);
printf("S:%f\n",S);
return 0;
15. Aylananing S maydoni berilgan. L=p∗D, S=p∗D 2 /4 ekanligini hisobga olib, uning diametri D va shu doirani chegaralovchi aylananing L uzunligini toping . p qiymati sifatida 3.14 dan foydalaning.
#include
#include
int main(void)
{
float S;
printf("S:");
scanf ("%f", &S);
float D = sqrt((4*S)/3.14);
printf("D:%f\n",D);
float L = 3.14*D;
printf("L:%f\n",L);
return 0;
}.
16. Sonlar oqi boyicha x 1 va x 2 koordinatalari berilgan ikki nuqta orasidagi masofani toping : |x 2 −x 1 |.
#include
#include
int main(void)
{
float x1, x2;
printf("x1:");
scanf ("%f", &x1);
printf("x2:");
scanf ("%f", &x2);
printf("%f\n",abs(x2-x1));
return 0;
}
17. Sonlar o'qida uchta A, B, C nuqtalari berilgan. AC va BC segmentlarining uzunliklarini va ularning yig‘indisini toping.
#include
#include
int main(void)
{
float A, B, C;
printf("A:");
scanf ("%f", &A);
printf("B:");
scanf ("%f", &B);
printf("C:");
scanf ("%f", &C);
float AC = abs(A-C);
printf("AC:%f\n",AC);
float BC = abs(B-C);
printf("BC:%f\n",BC);
printf("AC+BC:%f\n",BC+AC);
return 0;
}
18. Sonlar o'qida uchta A, B, C nuqtalari berilgan. C nuqta A va B nuqtalar orasida joylashgan. AC va BC segmentlari uzunliklarining ko'paytmasini toping.
#include
#include
int main(void)
{
float A, B, C;
printf("A:");
scanf ("%f", &A);
printf("B:");
scanf ("%f", &B);
printf("C:");
scanf ("%f", &C);
float AC = abs(A-C);
printf("AC:%f\n",AC);
float BC = abs(B-C);
printf("BC:%f\n",BC);
printf("AC+BC:%f\n",AC*BC);
return 0;
}
19. To'rtburchakning ikkita qarama-qarshi cho'qqisining koordinatalari berilgan: (x1,y1), (x2,y2) . To'rtburchakning tomonlari koordinata o'qlariga parallel. Ushbu to'rtburchakning perimetri va maydonini toping.
#include
#include
int main(void)
{
float x1,y1;
printf("x1:");
scanf ("%f", &x1);
printf("y1:");
scanf ("%f", &y1);
float x2,y2;
printf("x2:");
scanf ("%f", &x2);
printf("y2:");
scanf ("%f", &y2);
printf("P:%f\n",2*(abs(x1-x2)+abs(y1-y2)));
printf("S:%f\n",abs(x1-x2)*abs(y1-y2));
return 0;
}
20. Tekislikdagi (x 1 , y 1 ) va (x 2 , y 2 ) koordinatalari berilgan ikkita nuqta orasidagi masofani toping . Masofa √(x 2 - x 1 ) 2 + (y 2 - y 1 ) 2 formulasi yordamida hisoblanadi.
Paskal yechimi
#include
#include
int main(void)
{
float x1,y1;
printf("x1:");
scanf ("%f", &x1);
printf("y1:");
scanf ("%f", &y1);
float x2,y2;
printf("x2:");
scanf ("%f", &x2);
printf("y2:");
scanf ("%f", &y2);
printf("%f\n",sqrt(pow(x1-x2,2)+pow(y1-y2,2)));
return 0;
21. Uchburchakning uchta uchining koordinatalari berilgan: (x 1 ,y 1 ), (x 2 ,y 2 ), (x 3 ,y 3 ). Tekislikdagi ikkita nuqta orasidagi masofa formulasidan foydalanib uning perimetri va maydonini toping (Begin20 topshirig'iga qarang. A, b, c tomonlari bo'lgan uchburchakning maydonini topish uchun Heron formulasidan foydalaning:
Bu erda p = (a+b+c)/2 – yarim perimetr.
#include
#include
int main(void)
{
float x1,y1;
printf("x1:");
scanf ("%f", &x1);
printf("y1:");
scanf ("%f", &y1);
float x2,y2;
printf("x2:");
scanf ("%f", &x2);
printf("y2:");
scanf ("%f", &y2);
float x3,y3;
printf("x3:");
scanf ("%f", &x3);
printf("y3:");
scanf ("%f", &y3);
float a,b,c;
a=sqrt(pow(x1-x2,2)+pow(y1-y2,2));
b=sqrt(pow(x2-x3,2)+pow(y2-y3,2));
c=sqrt(pow(x3-x1,2)+pow(y3-y1,2));
float S,p;
p=(a+b+c)/2;
S=sqrt(p*(p-a)*(p-b)*(p-c));
printf("S:%f\n",S);
return 0;
}
22. A va B o'zgaruvchilari tarkibini almashtiring va A va B ning yangi qiymatlarini chiqaring .
#include
#include
int main(void)
{
float A,B;
printf("A:");
scanf ("%f", &A);
printf("B:");
scanf ("%f", &B);
A=A+B;
B=A-B;
A=A-B;
printf("\nA:%f\nB:%f\n",A,B);
return 0;
}
23. Berilgan o'zgaruvchilar A, B, C. A dan B ga, B dan C ga, C dan A ga ko'chirish orqali ularning qiymatlarini o'zgartiring va A, B, C o'zgaruvchilarning yangi qiymatlarini ko'rsating.
#include
int main(void)
{
float A,B,C;
printf("A:");
scanf ("%f", &A);
printf("B:");
scanf ("%f", &B);
printf("C:");
scanf ("%f", &C);
A=A+B+C;
B=A-B-C;
C=A-B-C;
A=A-B-C;
printf("\nA:%f\nB:%f\nC:%f\n",A,B,C);
return 0;
}
24. Berilgan o'zgaruvchilar A, B, C. A ning mazmunini C ga, C dan B ga, B dan A ga ko'chirish orqali ularning qiymatlarini o'zgartiring va A, B, C o'zgaruvchilarning yangi qiymatlarini ko'rsating.
#include
int main(void)
{
float A,B,C;
printf("A:");
scanf ("%f", &A);
printf("B:");
scanf ("%f", &B);
printf("C:");
scanf ("%f", &C);
A=A+C;
C=A-C;
A=A-C;
B=B+A;
A=B-A;
B=B-A;
printf("\nA:%f\nB:%f\nC:%f\n",A,B,C);
return 0;
}
|
| |