+ 4
Answer false, why?
int[] a={1,0,5,2,8}; int b=8; bool k=true; foreach(int t in a) { k=k&&t<b; } Console. Write(k) ;
3 Answers
+ 4
Because
k=k&&t<b;
for the last element of the list, 8,
k=true&&8<8=true&&false=false
If you change last element from 8 to 7 then result is
TRUE
+ 2
try that way:
int[] a={1,0,5,2,8};
int b=8;
bool k=true;
foreach(int t in a) {
k=k&&t<b;
Console. WriteLine(k);
}
0
ש×××