0% found this document useful (0 votes)
2 views

2

The document contains multiple C# programs that perform various mathematical calculations, including calculating the perimeter and area of triangles and circles, finding the distance between points, and performing basic arithmetic operations. Each program prompts the user for input values and outputs the results based on the calculations. The programs demonstrate the use of mathematical functions and conditional statements in C#.

Uploaded by

maulenov.b.03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

2

The document contains multiple C# programs that perform various mathematical calculations, including calculating the perimeter and area of triangles and circles, finding the distance between points, and performing basic arithmetic operations. Each program prompts the user for input values and outputs the results based on the calculations. The programs demonstrate the use of mathematical functions and conditional statements in C#.

Uploaded by

maulenov.b.03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

2

using System;

class Program

static void Main()

Console.Write("a = ");

double a = Convert.ToDouble(Console.ReadLine());

Console.Write("b = ");

double b = Convert.ToDouble(Console.ReadLine());

double c = Math.Sqrt(a * a + b * b);

double perimeter = a + b + c;

double s = (a * b) / 2;

Console.WriteLine("Perimetr =" + perimeter);

Console.WriteLine("Audan =" + s);

using System;

class Program

static double Distance(double x1, double y1, double x2, double y2)

return Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));

static void Main()

Console.Write("x1 = ");
double x1 = Convert.ToDouble(Console.ReadLine());

Console.Write("y1 = ");

double y1 = Convert.ToDouble(Console.ReadLine());

Console.Write("x2 = ");

double x2 = Convert.ToDouble(Console.ReadLine());

Console.Write("y2 = ");

double y2 = Convert.ToDouble(Console.ReadLine());

Console.Write("x3 = ");

double x3 = Convert.ToDouble(Console.ReadLine());

Console.Write("y3 = ");

double y3 = Convert.ToDouble(Console.ReadLine());

double A = Distance(x1, y1, x2, y2);

double B = Distance(x2, y2, x3, y3);

double C = Distance(x3, y3, x1, y1);

double p = A + B + C;

double p2= p / 2;

double s = Math.Sqrt(p2*(p2-A)*(p2-B)*(p2-C));

Console.WriteLine("Perimetr = " + p);

Console.WriteLine("Audan = " + s);

using System;

class Program
{

static void Main()

Console.Write("B = ");

double B = Convert.ToDouble(Console.ReadLine());

double L = 2 * Math.PI * B;

double S = Math.PI * Math.Pow(B, 2);

Console.WriteLine("Uzyndyq = " + L);

Console.WriteLine("Audan = " + S);

using System;

class Program

static void Main()

Console.Write("n = ");

int n = Convert.ToInt32(Console.ReadLine());

if ( n>= 1000 && n <= 9999)

int n1 = n / 1000;

int n2 = (n / 100) % 10;

int n3 = (n / 10) % 10;

int n4 = n % 10;

int s = n1*n2*n3*n4;
Console.WriteLine("s = " + s);

else

Console.WriteLine("Kate: Tort oryndy san engizu kerek!");

using System;

class Program

static void Main()

Console.Write("a = ");

double a = Convert.ToDouble(Console.ReadLine());

Console.Write("b = ");

double b = Convert.ToDouble(Console.ReadLine());

double akub = Math.Pow(a, 3);

double bkub = Math.Pow(b, 3);

double L = (akub + bkub) / 2;

double absa = Math.Abs(a);

double absb = Math.Abs(b);

double S = Math.Sqrt(absa * absb);

Console.WriteLine("Кубтарының арифметикалық ортасы: " + L);


Console.WriteLine("Модульдерінің геометриялық ортасы: " + S);

using System;

class Program

static void Main()

Console.Write("x1 = ");

double x1 = Convert.ToDouble(Console.ReadLine());

Console.Write("y1 = ");

double y1 = Convert.ToDouble(Console.ReadLine());

Console.Write("x2 = ");

double x2 = Convert.ToDouble(Console.ReadLine());

Console.Write("y2 = ");

double y2 = Convert.ToDouble(Console.ReadLine());

double L = Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));

Console.WriteLine("Екі нүктенің арақашықтығы: " + L);

using System;

class Program

{
static void Main()

Console.Write("x = ");

double x = Convert.ToDouble(Console.ReadLine());

Console.Write("y = ");

double y = Convert.ToDouble(Console.ReadLine());

double s1 = x + y;

double s2 = x - y;

double s3 = x * y;

double s4;

if (y != 0)

s4 = x / y;

Console.WriteLine("Бөлінді: " + s4);

else

Console.WriteLine("Бөлінді анықталмаған (0-ге бөлуге болмайды).");

Console.WriteLine("Қосынды: " + s1);

Console.WriteLine("Айырым: " + s2);

Console.WriteLine("Көбейтінді: " + s3);

You might also like