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

Program to check whether a word is a sub-string or not of a string typed

When is the last time you coded in C/C++? What is the most lines of original C/C++ code you have personally written in one project? How confident are you in your ability to write C or C++ without a reference?

How do you initialize a class member, class x { const int i; };

Problem 5: Hero's Formula is A method for calculating the area of a triangle when you know the lengths of all three sides. Let a, b, c be the lengths of the sides of a triangle. The area is given by:A= pp-ap-b(p-c) | wherep= a+b+c2 | | Write a C-language code to calculate area of triangle using above method. Take the three lengths of the triangle from the user and display the area that your program calculates.

What are the advantages and disadvantages of using inline and const?

Does defining a function inline mean that it wont push and pop things on/off the stack ...like parameters and the return the address??

What do you mean by abstraction. Explain your answer?

What are the basics of classifying different storage types, why?

Write the program form Armstrong no in c++?

In which memory a class gets stored(in heap /in stack)? And why??

if there is binary tree which one is the easiest way to delete all child node?

Memory is not a constraint. In a single iteration(NOTE: you can't go back), how will you find out the 10th last node/item in a linked list.

Categories