|
Butun tipli bir o‘lchamli massiv qanday e’lon qilanadi? Pdf ko'rish
|
bet | 171/194 | Sana | 20.02.2024 | Hajmi | 6,33 Mb. | | #159185 |
1. Butun tipli bir o‘lchamli massiv qanday e’lon qilanadi?
A) int [] massiv = new of 5
B) int [5] massiv = new int[5]
C) int [] new massiv = int[5]
D) int [] massiv = new int[5]
E) int [] massiv = new int 5
2. Dasturni ishga tushirganda ekranda qanday natija xosil bo‘ladi?
using System;
class Test {
public static void Main() {
int[,] a={{-3,6,5},{-1,2,8},{3,1,-4}};
int p = 0;
foreach (int x in a)
{
if (x % 2 != 0) { p = p + x; }
} Console.WriteLine(p);
} }
A) 4
B) 5
C)16
D)9
E)12
3. Dasturni ishga tushirganda ekranda qanday natija xosil bo‘ladi?
using System;
class Test {
public static void Main()
{ int[] mas1=new int[6];
int[,] mas2=new int[3,3];
int s, p; s = 0; p = 1;
for (int i = 1; i < mas1.Length; i++) s = s + 2;
for (int i = 1; i < mas2.Length; i++) p=p*2;
Console.WriteLine(s);
Console.WriteLine(p);
} }
A) 8
128
B)
12
256
C)
10
4
D)
12
8
E)
10
256
4. Satrni quyidagilardan qaysisi noto‘g‘ri e’lon qilingan?
A) string str=”Bu satr”
B) char[] ch={‘s’, ‘a’, ‘t’. ‘r’};
String str=new string(ch);
C) string[] str={“bu”, “satr”}
D) string str=new string[5]
E) string str;
Dasturlash tillari va axborot-kommunikatsiya texnologiyalari 1-semestr
308
5. Agar str1=”satr”, str2=”ikkinchi satr” bo‘lsa str2.IndexOf(str1), str2.LastIndexOf(str1), str2.Substring(3, 4)
larning qiymati mos ravishda nimaga teng?
A) 9, 4, inch
B) 9, 9, kinc
C) 9, 9, inch
D) 8, 8,.kinc
E) -1, -1, inch
|
| |