Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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;
}

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between c++ 11 and c++ 14?

1103


What is the type of 'this' pointer?

1022


Explain selection sorting?

1090


What are the c++ access specifiers?

1426


. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?

3282


Explain the uses of static class data?

1111


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

1000


Explain the use of vtable.

1091


Write a note about the virtual member function?

1064


What causes a runtime error c++?

1130


What is the best c++ ide?

1178


Explain the different access specifiers for the class member in c++.

1012


What is a singleton class c++?

1040


How are the features of c++ different from c?

1106


what is a reference variable in C++?

1244