C# da malumotlarni ekranga chiqaruvchi ko’dni ko’rsating?


Download 23.44 Kb.
Sana16.06.2023
Hajmi23.44 Kb.
#1496780
Bog'liq
C# test 10 ta


****[1]

  1. C# da malumotlarni ekranga chiqaruvchi ko’dni ko’rsating?

++++
#Console.WriteLine("Hello World!");
++++
Print(“Hello World”)
++++
printf("Hello World!");
++++
cout << "Hello World!";
%%%%

****[2]


  1. C# da izohlar qanday tegdan keyin yoziladi?

++++
#(//)dasturga sharh
++++
(#) dasturga sharh
++++
(**)dasturga sharh
++++
(--)dasturga sharh
%%%%

****[3]


  1. C# da sonli o'zgaruvchilarning turlari?

++++
#Int, double
++++
Char, string
++++
Bool, double
++++
Int, Bool
%%%%

****[4]


  1. C# da int myInt = 10 o’zgaruvchini int ni satrga aylantirish kodini toping?

++++
# Console.WriteLine(Convert.ToString(myInt));
++++
Console.WriteLine(Convert.ToDouble(myInt));
++++
Console.WriteLine(Convert.ToInt32(myDouble));
++++
Console.WriteLine(Convert.ToString(myBool));
%%%%

****[5]


  1. C# da foydalanuvchidan ma’lumot olish kodini ko’rsating?

++++
#Console.ReadLine()
++++
Console.WriteLine()
++++
Int.input()
++++
Cin>>
%%%%

****[6]


  1. C# da 2 ta sonning katasini chiqaruvchi ko’dni ko’rsating?

++++
#Math.Max(x,y)
++++
Math.Min(x,y)
++++
Math.Sqrt(x)
++++
Math.Abs(x)
%%%%

****[7]


  1. C# da dastur natijasi nima chiqadi?

string txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Console.WriteLine("The length of the txt string is: " + txt.Length);
++++
#The length of the txt string is: 26
++++
The length of the txt string is: 10
++++
The length of the txt string is: 80
++++
The length of the txt string is:46
%%%%

****[8]


  1. C# da dastur natijasini ko’rsating?

string txt = "Hello World";
Console.WriteLine(txt.ToUpper());
Console.WriteLine(txt.ToLower());

++++
# "HELLO WORLD"


"hello world"
++++
"hello world"
"HELLO WORLD"
++++
"hello world"
"hello world"
++++
"HELLO WORLD"
"HELLO WORLD"
%%%%

****[9]


  1. C# da dastur natijasini ko’rsating?

int x = 20;
int y = 18;
if (x > y)
{ Console.WriteLine("x kata y dan");}
Else{ Console.WriteLine("y kata x dan");}
++++
# x kata y dan
++++
y kata x dan
++++
Hatolik
++++
x kata
%%%%
****[10]

  1. C# da dastur natijasini ko’rsating?

int i = 0;
while (i < 5)
{
Console.WriteLine(i);
i++;
}
++++
#0
1
2
3
4
++++
4
++++
hato
++++
1
2
3
4
%%%%

  1. C# da dastur natijasini ko’rsating?

string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};


Console.WriteLine(cars[1]);
// Outputs Volvo
}
++++
# BMW
++++
Volvo
++++
Ford
++++
Mazda
%%%%



  1. C# da quyidagi dastur natijasini ko’rsating?

string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};


Console.WriteLine(cars.Length);
++++
# 4
++++
3
++++
Ford
++++
Mazda
%%%%



  1. C# da quyidagi dastur natijasini ko’rsating?

string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};


for (int i = 0; i < cars.Length; i++)
{
Console.WriteLine(cars[i]);
}
++++
# Volvo
BMW
Ford
Mazda
++++
Volvo
++++
Ford
++++
Mazda
%%%%
Download 23.44 Kb.

Do'stlaringiz bilan baham:




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