Begin Kvadratning tomoni a berilgan. Uning perimetri aniqlansin. P=4*a C# dagi dastur matni



Download 115 Kb.
bet1/2
Sana26.11.2019
Hajmi115 Kb.
  1   2
Begin_1. Kvadratning tomoni a berilgan.Uning perimetri aniqlansin. P=4*a

C# dagi dastur matni:

/*
 * Created by SharpDevelop.


 * User: User
 * Date: 15.11.2018
 * Time: 8:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace Begin1
{
    class Program
    {
        public static void Main(string[] args)
        {
            int P,a;
            Console.WriteLine("a ni kiriting: ");
            a=int.Parse(Console.ReadLine());
            P=4*a;
            Console.WriteLine("Kvadratning perimetri "+P);
            Console.ReadKey();
        }
    }
}

Natija:



Begin_2. Kvadratning tomoni a berilgan .Uning yuzasi aniqlansin.S=a*a

C# dagi dastur matni:

/*
 * Created by SharpDevelop.


 * User: User
 * Date: 15.11.2018
 * Time: 8:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace Begin1
{
    class Program
    {
        public static void Main(string[] args)
        {
            int S,a;
            Console.WriteLine("a ni kiriting: ");
            a=int.Parse(Console.ReadLine());
            S=a*a;
            Console.WriteLine("Kvadratning yuzi "+S);
            Console.ReadKey();
        }
    }
}



Begin_3.To’g’ri to’rtburchakning tomonlari a va b berilgan.Uning yuzasi S=a*b va P=2*(a+b) perimetri aniqlansin.

C# dagi dastur matni:

/*
 * Created by SharpDevelop.


 * User: User
 * Date: 15.11.2018
 * Time: 8:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace Begin1
{
    class Program
    {
        public static void Main(string[] args)
        {
            int P,S,a,b;
            Console.WriteLine("a ni kiriting: ");
            a=int.Parse(Console.ReadLine());
            Console.WriteLine("b ni kiriting: ");
            b=int.Parse(Console.ReadLine());
            S=a*a;P=2*(a+b);
            Console.WriteLine("To'g'ri to'rtburchakning yuzasi: "+S);
            Console.WriteLine("To'g'ri to'rtburchakning perimetri: "+P);
            Console.ReadKey();
        }
    }
}



Begin_4. Aylananing diametri d berilgan.Uning uzunligi aniqlansin.

L=Pi*d (Pi=3,14).



/*
 * Created by SharpDevelop.
 * User: User
 * Date: 15.11.2018
 * Time: 15:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace begin4
{
    class Program
    {
        public static void Main(string[] args)
        {
            double d,l;
            Console.WriteLine("d ni kiriting: ");
            d=double.Parse(Console.ReadLine());
            l=Math.PI*d;
            Console.WriteLine("Aylana uzunligi:l="+l);
            Console.ReadKey();
         }
     }
}



Begin_5.Kubning qirrasi a berilgan, uning hajmi V=a*a*a va sirti S=6*a*a ni toping.

C# dagi dastur matni:

/*
 * Created by SharpDevelop.


 * User: User
 * Date: 15.11.2018
 * Time: 15:46
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace bebin4
{
    class Program
    {
        public static void Main(string[] args) 
        {
            double a,S,V;
            Console.WriteLine("a ni kiriting: ");
            a=double.Parse(Console.ReadLine());
            V=Math.Pow(a,3);S=6*(a*a);
            Console.WriteLine("Kvadratning hajmi:V="+V);
            Console.WriteLine("kvadratning sirti:S="+S);
            Console.ReadKey();
        }
    }
}




Do'stlaringiz bilan baham:
  1   2


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

    Bosh sahifa