c++ test!
If you have "int main(int argc, char* argv[])" and invoke your program this way:
prog.exe a.out -i 2 -g -x 3 4
What will be the value of argc?
a) 0
b) a.out
c) 2
d) 3
e) 7
f) Other
g) I don't know
If we have:
int f(int x)
{
if(x>2)
return x + f(--x);
else
return 0;
}
What will be the resulf of: cout << f(5);
a) Program will freeze
b) 0
c) 6
d) 10
e) 12
f) Other
g) I don't know
If we have this code:
char arr[8];
cin >> arr;
And this text is entered: "Hello World", what there will be in "arr"?
a) Hello World
b) Hello Wo
c) Hello W
d) Hello
e) Other
f) I don't know
What will happen if we have this code:
char a[3] = {'d','w','\0'};
char b[3];
b = a;
a) "b" will be the same as "a"
b) "b" will be unchanged
c) Compiler error
d) Other
e) I don't know