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 are the different types of polymorphism in c++?

1134


What is iomanip c++?

1078


What operator is used to access a struct through a pointer a) >> b) -> c) *

1109


Why do we use string in c++?

939


Is python written in c or c++?

1139


Comment on local and global scope of a variable.

1153


Are c and c++ different?

980


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

976


Is c++ a pure oop language?

1080


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

1074


Why is c++ called oops?

1169


What's the hardest coding language?

1002


Explain the pure virtual functions?

1120


Is c++ the best programming language?

1014


What is function prototyping?

1096