Consider the following code fragment:
int main(void) {
int m = 4;
mystery ( m );
mystery ( m );
printf("%d", m);
return 0;
}
What is the output on the monitor if mystery is defined as
follows ?
void mystery (int m) {
m = m+3;
}
Answers were Sorted based on User's Feedback
Answer / c++ coder
Output will be 4 only.
since the argument is not passed by reference so a local
copy of m is used in the function call which is local to
mystery() it will not have any impact on the variable m
which is used in main() function.
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / rahul darekar
since in c lang we have to define fun first before we use it
but in this program fun mystery() in not defined and still
it is called so it will give error.
| Is This Answer Correct ? | 3 Yes | 1 No |
How can you differentiate between inheritance and implementation in c++?
How do you declare a set in c++?
What is the most powerful coding language?
What is the use of :: operator in c++?
Explain the concept of dynamic allocation of memory?
Explain the benefits of proper inheritance.
What are the differences between new and malloc?
What is a tuple c++?
What is the return value of the insertion operator?
How compile and run c++ program in turbo c++?
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
Is facebook written in c++?