Given the following function definition: int doit(int &x,
int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z -
4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

Answers were Sorted based on User's Feedback

Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y ..

a = 15
b = 7
c = 27
d = 23

 Is This Answer Correct ? 8 Yes 0 No

Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y ..

I think it will be

a = 15
b = 7
c = 27
d = 4

 Is This Answer Correct ? 4 Yes 6 No

More C++ General Interview Questions

How do you generate a random number in c++?

Explain the problem with overriding functions

What is #include cmath?

Define pointers?

give me an example for testing a program showing the test path .show how the test is important and complex.

Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1

is throwing exception from a constructor not a good practice ?

class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4

whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };

How can you quickly find the number of elements stored in a dynamic array?

What is general format for a prototype?

In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

Categories