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

Who calls main function?

1163


Is there finally in c++?

1150


What is the outcome of cout< a) 16 b) 17 c) 16.5

1068


What are the important differences between c++ and java?

1201


What is pointer with example?

1125


Using a smart pointer can we iterate through a container?

1143


What is the purpose of the "delete" operator?

1114


What is the difference between #define debug 0 and #undef debug?

1238


Is c++ low level?

1074


Is map thread safe c++?

1129


program explaining feautures of c++

2494


What is meant by iomanip in c++?

1290


What is a local variable?

1133


I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?

2118


What is the use of 'using' declaration in c++?

1196