Kompyuter ilimlari va dasturlashtirish” kafedrasi


-mavzu: Takrorlash operatorlari



Download 6 Mb.
bet5/12
Sana18.07.2022
Hajmi6 Mb.
#821533
1   2   3   4   5   6   7   8   9   ...   12
Bog'liq
Sodiqov Davron hisobot original

8-mavzu: Takrorlash operatorlari.
9-mavzu:Shartsiz o’tish operatori.


2-amaliy topshiriq



using System;

namespace ConsoleApp36


{
class Program
{
static void Main(string[] args)
{
double s = 0;
double a = 0;
double b = 3.14;
double h = (b - a) / 100;
double[] x = new double[1000];
//chap turtburchak
for (int i = 0; i <= 99; i++)
{
x[i] = 1 + i * h;

Console.WriteLine(" " + x[i]);


s = s + Math.Log(2+Math.Sin(x[i]));
}

13.Kabisa yili hafta kuni aniqlansin
using System;
using static System.Console;
using static System.Math;
namespace davronbek
{
class Program
{
static void Main(string[] args)
{
Write("yilni kiriting: ");
int yil = Convert.ToInt32(ReadLine());
Write("Oyni kiriting: ");
int oy = Convert.ToInt32(ReadLine());
Write("Kunni kiriting: ");
int kun = Convert.ToInt32(ReadLine());
if ((yil % 100 == 0 && yil % 400 == 0) || (yil % 100 != 0 && yil % 4 == 0))
{
switch (oy)
{
case 1:
switch (kun % 7)
{
case 0: Write("yakshanba"); break;
case 1: Write("dushanba"); break;
case 2: Write("seshanba"); break;
case 3: Write("chorshanba"); break;
case 4: Write("payshanba"); break;
case 5: Write("juma"); break;
case 6: Write("shanba"); break;

}
break;


case 2:
switch (kun % 7)
{
case 4: Write("yakshanba"); break;
case 5: Write("dushanba"); break;
case 6: Write("seshanba"); break;
case 0: Write("chorshanba"); break;
case 1: Write("payshanba"); break;
case 2: Write("juma"); break;
case 3: Write("shanba"); break;

}
break;


case 3:
switch (kun % 7)
{
case 3: Write("yakshanba"); break;
case 4: Write("dushanba"); break;
case 5: Write("seshanba"); break;
case 6: Write("chorshanba"); break;
case 0: Write("payshanba"); break;
case 1: Write("juma"); break;
case 2: Write("shanba"); break;

}
break;


case 4:
switch (kun % 7)
{
case 0: Write("yakshanba"); break;
case 1: Write("dushanba"); break;
case 2: Write("seshanba"); break;
case 3: Write("chorshanba"); break;
case 4: Write("payshanba"); break;
case 5: Write("juma"); break;
case 6: Write("shanba"); break;

}
break;


case 5:
switch (kun % 7)
{
case 5: Write("yakshanba"); break;
case 6: Write("dushanba"); break;
case 0: Write("seshanba"); break;
case 1: Write("chorshanba"); break;
case 2: Write("payshanba"); break;
case 3: Write("juma"); break;
case 4: Write("shanba"); break;

}
break;


case 6:
switch (kun % 7)
{
case 2: Write("yakshanba"); break;
case 3: Write("dushanba"); break;
case 4: Write("seshanba"); break;
case 5: Write("chorshanba"); break;
case 6: Write("payshanba"); break;
case 0: Write("juma"); break;
case 1: Write("shanba"); break;
}
break;
case 7:
switch (kun % 7)
{
case 0: Write("yakshanba"); break;
case 1: Write("dushanba"); break;
case 2: Write("seshanba"); break;
case 3: Write("chorshanba"); break;
case 4: Write("payshanba"); break;
case 5: Write("juma"); break;
case 6: Write("shanba"); break;

}
break;


case 8:
switch (kun % 7)
{
case 4: Write("yakshanba"); break;
case 5: Write("dushanba"); break;
case 6: Write("seshanba"); break;
case 0: Write("chorshanba"); break;
case 1: Write("payshanba"); break;
case 2: Write("juma"); break;
case 3: Write("shanba"); break;

}
break;


case 9:
switch (kun % 7)
{
case 1: Write("yakshanba"); break;
case 2: Write("dushanba"); break;
case 3: Write("seshanba"); break;
case 4: Write("chorshanba"); break;
case 5: Write("payshanba"); break;
case 6: Write("juma"); break;
case 0: Write("shanba"); break;

}
break;


case 10:
switch (kun % 7)
{
case 6: Write("yakshanba"); break;
case 0: Write("dushanba"); break;
case 1: Write("seshanba"); break;
case 2: Write("chorshanba"); break;
case 3: Write("payshanba"); break;
case 4: Write("juma"); break;
case 5: Write("shanba"); break;

}
break;


case 11:
switch (kun % 7)
{
case 3: Write("yakshanba"); break;
case 4: Write("dushanba"); break;
case 5: Write("seshanba"); break;
case 6: Write("chorshanba"); break;
case 0: Write("payshanba"); break;
case 1: Write("juma"); break;
case 2: Write("shanba"); break;

}
break;


case 12:
switch (kun % 7)
{
case 0: Write("yakshanba"); break;
case 1: Write("dushanba"); break;
case 2: Write("seshanba"); break;
case 3: Write("chorshanba"); break;
case 4: Write("payshanba"); break;
case 5: Write("juma"); break;
case 6: Write("shanba"); break;
}
break;
}
}
else
{
Write("Kabisa yili emas");
WriteLine();
}
}
}
}


Download 6 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   12




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