Maxakamov Abdusamat 103-19 guruh talabasi Dasturlash Texnalogiyalari 15-amaliy



Download 180,5 Kb.
Sana31.12.2021
Hajmi180,5 Kb.
#218426
Bog'liq
MaxkamovAbdusamat15amaliy


Maxakamov Abdusamat 103-19 guruh talabasi Dasturlash Texnalogiyalari 15-amaliy:

23. Uchburchakning ikkita burchagi (gradusda) berilgan. Bunday uchburchak mavjudligini, agar mavjud bo‘lsa uning to‘g‘ri burchakli ekanligini aniqlang.



Anonim sifatida:

using System;

namespace Maxkamov_Abdusamat{

    class Program{

        delegate double burchak(double x, double y);

        static void Main(){

            burchak Uchburchak=delegate(double x, double y){

                double z=x+y,m=180,n,a;

                n=m-z;

                if(z<180){

                    Console.WriteLine("Uchburchak yasash mumkin.");

                    a=1;

                }else{

                    Console.WriteLine("Uchburchak yasash mumkin emas.");

                    a=0;

                }

                if(a==1){

                    if(n==90){

                        Console.WriteLine("Berilgan Uchburchak To'g'ri burchakli uchburchak.");

                        Console.WriteLine("alfa= "+x+"\nbetta= "+y+"\ngamma= "+n);

                    }

                    else {

                        Console.WriteLine("Berilgan Uchburchak har xil burchakli uchburchak.");

                        Console.WriteLine("alfa= "+x+"\nbetta= "+y+"\ngamma= "+n);

                    }

                }

                return z;

            };

            Console.Write("alfa burchak: ");

            double alfa=double.Parse(Console.ReadLine());

            Console.Write("betta burchak: ");

            double betta=double.Parse(Console.ReadLine());

           Uchburchak(alfa, betta);           

        }

    }

}



Funksiya sifatida:

using System;

namespace Maxkamov_Abdusamat{

    class Program{

       public double uchburchak(double x, double y){

           double z=x+y,m=180,n,a;

                n=m-z;

                if(z<180){

                    Console.WriteLine("Uchburchak yasash mumkin.");

                    a=1;

                }else{

                    Console.WriteLine("Uchburchak yasash mumkin emas.");

                    a=0;

                }

                if(a==1){

                    if(n==90){

                        Console.WriteLine("Berilgan Uchburchak To'g'ri burchakli uchburchak.");

                        Console.WriteLine("alfa= "+x+"\nbetta= "+y+"\ngamma= "+n);

                    }

                    else {

                        Console.WriteLine("Berilgan Uchburchak har xil burchakli uchburchak.");

                        Console.WriteLine("alfa= "+x+"\nbetta= "+y+"\ngamma= "+n);

                    }

                }    

           return z;

       }


        static void Main(){

            Console.Write("alfa burchak: ");

            double alfa=double.Parse(Console.ReadLine());

            Console.Write("betta burchak: ");

            double betta=double.Parse(Console.ReadLine());

            Program a= new Program();

           a.uchburchak(alfa, betta);           

        }



    }

}


Download 180,5 Kb.

Do'stlaringiz bilan baham:




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish