Operators

dilshod raxmadjonov - Oct 11 - - Dev Community

a) Quyidagi codeda if, else if, else qanday ishlaydi?
Javob:
int x = 10; //x degan o'zgaruvchi yaratamiz va 10-ga tenglaymiz

if(x < 5) //agar x 5-dan kichik bo'lsa, pastdagi text chiqadi
{
Console.WriteLine("Less than 5");
}
else if(x == 10) //agar x 10-ga teng bo'lsa, pastdagi text chiqadi
{
Console.WriteLine("Equal to 10");
}
else //agar hech qaysi shart kelmasa, pastdagi text chiqadi
{
Console.WriteLine("Greater than 5");
}

c)Quyidagi kodda switch qismida qaysi natija chiqadi?
Javob: Wednesday

. . . . . . . . .
Terabox Video Player