- 1
What is the output of this code?
static int Test(out int x, int y=4) { x = 6; return x * y; } static void Main(string[] args) { int a; int z = Test(out a); Console.WriteLine(a + z); }
38 Antworten
+ 8
The answer is 30
+ 14
What is the output of this code?
int * test() {
static int x[4];
for(int i=0;i<4;i++){
x[i] = i%2;
}
return x;
}
int main() {
int * arr = test();
printf("%d", *(arr+3));
}
The output is 1
+ 2
14
+ 1
The ans is not 24
+ 1
What is the output of this code?
class A
def initialize(x)
puts x/2
end
end
class B < A
def initialize(y)
super(y+2)
end
end
ob = B.new(6)
Answer: 4
+ 1
answer is 30
+ 1
What is the output of this code?
30
+ 1
1 is the correct answer
0
A compile error ^.^
0
Compiles and runs just fine if it's wrapped in a class. Then the answer is 30.
class Program
{
static int Test(out int x, int y=4) {
x = 6;
return x * y;
}
static void Main(string[] args) {
int a;
int z = Test(out a);
Console.WriteLine(a + z);
}
}
0
def unlucky_days(year)
(1..12).count { |month| Time.new(year, month, 13).friday? }
end
year = 2017
puts unlucky_days(year)
https://www.sololearn.com/discuss/276583/?ref=app
0
Test Test:: (Test obj) {
newObj;
newObj.mem =
mem obj.mem;
return newObj;
}
0
3
0
3
0
static void ______ (string[] args)
{
int x = (4 + 3) * 2;
____ .____ (x);
} help me guys
0
0
What is the output of this code?
int * test() {
static int x[4];
for(int i=0;i<4;i++){
x[i] = i%2;
}
return x;
}
int main() {
int * arr = test();
printf("%d", *(arr+3));
}
0
1
0
the ans is 1
0
The correct ans is 3