Toshkent axborot texnologiyalari universiteti axborot xavfszligi fakulteti


Download 219.98 Kb.
Sana29.11.2020
Hajmi219.98 Kb.

TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

AXBOROT XAVFSZLIGI FAKULTETI

710-20 GURUH TALABASI ABDUQODIROV SARVARNING

Dasturlash-1 fanidan 5-laborotoriya mashg’uloti



8-variant

  1. Doiraning yuzini hisoblovchi funksiya hosil qiling. Bu funksiya yordamida 3 ta doira yuzini hisoblang.

  1. #include

  2. #include

  3. using namespace std;

  4. int main ()

  5. {

  6. float pi=3.14, r, S;

  7. cout<<"Doira radiusini kiriting: r= "; cin>>r;

  8. S=pi*pow(r,2);

  9. cout<<"Doira yuzi: s= "<

  10. return main();

  11. }

Doira radiusi qilib 5, 10, 15 ni oldim.



  1. n va m natural soni berilgan. Shu sonlar EKUBini topuvchi funksiya yarating. Ushbu funksiya yordamida a va a1, b va b1 sonlari uchun EKUB ni toping.

  1. #include

  2. #include

  3. using namespace std;



  1. int ekub1(int i)

  2. { int n, m, x=10000000;

  3. cout<<"n="; cin>>n;

  4. cout<<"m="; cin>>m;

  5. for(i=1; i

  6. if(i%n==0 && i%m==0 ) break;

  7. //cout<<"EKUB(n;m)="<

  8. return i; }



  1. int ekub2(int i)

  2. {int a, a1, x=100000;

  3. cout<<"a="; cin>>a;

  4. cout<<"a1="; cin>>a1;

  5. for(i=1; i

  6. if(i%a==0 && i%a1==0 ) break;

  7. //cout<<"EKUB(a;a1)="<

  8. return i;

  9. }

  10. int ekub3(int i)

  11. {int b, b1, x=100000;

  12. cout<<"b="; cin>>b;

  13. cout<<"b1="; cin>>b1;

  14. for(i=1; i

  15. if(i%b==0 && i%b1==0 ) break;

  16. //cout<<"EKUB(b;b1)="<

  17. return i;

  18. }



  1. int main()

  2. {int i;

  3. cout<<"EKUB(n;m)="<

  4. cout<<"EKUB(a;a1)="<

  5. cout<<"EKUB(b;b1)="<

  6. }


Download 219.98 Kb.

Do'stlaringiz bilan baham:




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