Bajardi: atm-3 guruhi talabasi


Download 357.35 Kb.
Sana29.10.2023
Hajmi357.35 Kb.
#1733369
Bog'liq
labarayoriya (2)



TOSHKENT DAVLAT TRANSPORT UNIVERSITETI
Dasturlash tillari vatexnologiyalari fanidan

2-Labaratoriya ishi


BAJARDI: ATM-3 guruhi talabasi


Jo‘raboyeva N
QABUL QILDI:
Xakimov.Sh.X

2-labaratoriya ishi uchun 1- darajali topshiriqlar.

1. Shakl nomiga qarab (uchburchak, kvadrat, romb, to’g’ri to’rtburchak va hokazo) uning yuzasini hisoblash formulasini ekranga chiqaruvchi dastur tuzing.
Dastur
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5


{
class Program
{

static void Main()


{

string a = Console.ReadLine();


switch (a)
{

case "uchburchak":


Console.Write(" uchburchak S=√(p*(p-a)*(p-b)*(p-c))");
break;
case"kvadrat":
Console.WriteLine(" kvadrat S=a*a ");
break;
case "romb":
Console.WriteLine(" romb S=(d1*d2)/2");
break;
case "to`g`ri to`rtburchak":
Console.WriteLine(" to`g`ri to`rtburchak S=a*b");
break;

}
Console.ReadKey();


}
}

}
Natija



2-labaratoriya ishi uchun 2-darajali topshiriqlar.


2. Uchta raqam berilgan, ularning birortasining yig'indisi musbat ekanligini aniqlang.
Dastur:
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("a=");
double a = double.Parse(Console.ReadLine());
Console.WriteLine("b=");
double b = double.Parse(Console.ReadLine());
Console.WriteLine("c=");
double c = double.Parse(Console.ReadLine());
if (a + b > 0 || a + c > 0 || b + c > 0) { Console.WriteLine("musbat"); }
Console.ReadKey();
}
Natija:



}
Download 357.35 Kb.

Do'stlaringiz bilan baham:




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