Savol: C# tilida "Hello, World!" ni chop etish uchun qanday kod yoziladi?
Download 15.61 Kb.
|
test 14 ta
Savol: C# tilida "Hello, World!" ni chop etish uchun qanday kod yoziladi? A) Console.WriteLine("Hello, World!"); B) System.Print("Hello, World!"); C) Print("Hello, World!"); D) MessageBox.Show("Hello, World!"); Javob: A) Savol: C# tilida "int" ma'lumot turini qanday ifodalash mumkin? A) int
C) Int32 D) all of the above Javob: D) Savol: C# tilida "for" tsikli qanday yoziladi? A) for (i = 0; i < 10; i++) B) for i = 0 to 10 C) while (i < 10) D) do { } while (i < 10); Javob: A) Savol: C# tilida "switch" operatori qanday yoziladi? A) switch (variable) {case value1:// code to execute when variable == value1 break; case value2:// code to execute when variable == value2 break; default: // code to execute when none of the above conditions are met break;} B) if (variable == value1) {// code to execute when variable == value1} else if (variable == value2) { // code to execute when variable == value2 } else {// code to execute when none of the above conditions are met} C) switch variable { case value1: // code to execute when variable == value1 break; case value2: // code to execute when variable == value2 break; default: // code to execute when none of the above conditions are met break;} D) if (variable == value1) {// code to execute when variable == value1} else {if (variable == value {// code to execute when variable == value2} else {// code to execute when none of the above conditions are met} Javob: A) Savol: C# tilida "class" nima? A) Class, obyekt tuzish uchun kerakli ma'lumotlar va funksiyalar majmuasi.
Javob: A) Savol: C# tilida "string" ma'lumot turini qanday ifodalash mumkin? A) string B) text C) String D) str Javob: C) Savol: C# tilida "foreach" operatori qanday yoziladi? A) foreach (item in collection) {// code to execute for each item in collection} B) for (i = 0; i < collection.Length; i++) {item = collectioni; // code to execute for each item in collection} C) while (i < collection.Length) {item = collectioni; // code to execute for each item in collectioni++} D) do { } while (i < collection.Length); Javob: A) 1. C# dasturlash tili qaysi platformalar uchun mo'ljallangan? Variantlar: a) Windows b) Linux c) Android d) Hammasi yolg'on Tog'ri javob: a) 2. C# dasturlash tilida oddiy matematik amallari qanday amalga oshiriladi? Variantlar: a) Matematik kutubxonasi yuklanadi va funksiyalar chaqiriladi.
Tog'ri javob: b) 3. C# dasturlash tili ko'p ob'yektorli bo'lib, shu sababli "kalit so'z" nima deb ataladi? Variantlar: a) "Kalit so'z" - bu sinf nomi.
Tog'ri javob: b) 4. C# dasturlash tilida for tsikli qanday ishlatiladi? Variantlar: a) for (i=1; i<=5; i++) {Console.WriteLine(i);}
Tog'ri javob: a) 5. C# dasturlash tilida "switch" operatori qanday ishlatiladi? Variantlar: a) switch (x = 2) {case 1: Console.WriteLine("Bir"); break; case 2: Console.WriteLine("Ikki"); break;}
Tog'ri javob: a) 6. C# dasturlash tilida "try-catch" bloklari nima uchun ishlatiladi? Variantlar: a) Xatolarni aniqlash vaqtida to'xtatish uchun.
Tog'ri javob: a) 7. C# dasturlash tili "abstract" sinflar bilan qanday ishlaydi? Variantlar: a) Abstract sinflar faqat boshqa sinflarda ishlatiladi. b) Abstract sinflar obyektlarini yaratib ishlatish mumkin emas. c) Abstract sinflar faqat metodlarini qabul qiladi, ularning funksiyalari boshqa sinflarda aniqlanadi. d) Abstract sinflar boshqa sinflardan miras olindi, ularning metodlari va o'zgaruvchilari o'zgartirilgan holda ishlatiladi. Tog'ri javob: b) Download 15.61 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling