Ularnig yuzalari S1 va S2


Download 14.36 Kb.
Sana28.12.2022
Hajmi14.36 Kb.
#1021602
Bog'liq
malumotlar tusilmasi va algoritmlash


1.
Begin13. Umumiy markazga ega bo'lgan ikkita aylana radiusi berilgan. R1,R2 (R1>R2).Ularnig yuzalari S1 va S2, ularning ayirmasi S3 aniqiansin. Sl =pi*R12, S2=pi*R22, S3 =pi(R12- R22).
#include
#include
int main()
{ int R1,R2,S1,S2,S3;
float const PI=3.14;
cout<<"R1="; cin>> R1;
cout<<"R2="; cin>> R2;
S1=PI*R1*R1;
S2=PI*R2*R2;
S3=PI*(R1*R1-R2*R2);
cout<<"S1="<
cout<<"S2="<
cout<<"S3="<
system("pause");
return 0;
}
4. Uchta А, В, С butun sonlar berilgan. Jumlani rostlikka tekshiring: “А, В, С sonlarning hech bo’lmaganda bittasi musbat".
$a = $_POST['a'];
$b = $_POST['b'];
$c = $_POST['c'];
var_dump((($a>0)and($b<0)and($c<0))or(($a<0)and($b>0)and($c<0))or (($a<0)and($b<0)and($c>0)));
?>


a=


b=


c=





?>
5. Uch xonali son berilgan. Uning raqamlarini teskari tartibda yozishdan hosil bo'lgan sonni aniqlovchi program tuzilsin.


#include
#include
int main()
{
int a,b,c,d,e,f;
cout<<"uch xonali sonni kiriting->";cin>>a;
b=a/100; c=a-b*100; d=c/10; e=c-d*10; f=b+10*d+100*e;
cout<<"uning raqamlarining o'rnini almashtirishdan hosil bo'lgan son->"<system ("pause");
return 0;
}
Download 14.36 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling