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

Are iterators pointers?

1104


Is java the same as c++?

938


Is c++ an integer?

972


What is a class template?

1025


Why do we use using namespace std in c++?

1027


Can a list of string be stored within a two dimensional array?

959


what is pre-processor in C++?

1090


What is the main purpose of c++?

1013


Are strings mutable in c++?

1089


Give example of a pure virtual function in c++?

1085


What is implicit pointer in c++?

1032


How would you use the functions randomize() and random()?

1022


What is ios class in c++?

1028


What is a forward referencing and when should it be used?

1100


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

2274