What is the output of the following code:
int v()
{
int m=0;
return m++;
}
int main()
{
cout<<v();
}




1) 1


2) 0


3) Code cannot compile

Answers were Sorted based on User's Feedback



What is the output of the following code: int v() { int m=0; return m++; } int main() { cou..

Answer / shailaja

the output of this code is

0
bcz here the return statement it will stops the execution
and returns to the calling function.

Is This Answer Correct ?    8 Yes 0 No

What is the output of the following code: int v() { int m=0; return m++; } int main() { cou..

Answer / sivasankar

output is 0

Is This Answer Correct ?    7 Yes 1 No

What is the output of the following code: int v() { int m=0; return m++; } int main() { cou..

Answer / raju

ans 0

first it return value ofter that it increment

Is This Answer Correct ?    3 Yes 2 No

What is the output of the following code: int v() { int m=0; return m++; } int main() { cou..

Answer / durga shankar mishra

write answer of the 0

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More OOPS Interview Questions

What is difference between abstraction and encapsulation?

0 Answers  


What is the difference between an object and a class?

3 Answers  


What does and I oop mean?

0 Answers  


How to Increment the value of the empid E001 for each and every employee by using the programe?

1 Answers   Accenture,


write a program that takes input in digits and display the result in words from 1 to 1000

0 Answers   Wipro,


What does sksksk mean in text slang?

0 Answers  


what are the disadvantages of C++?

25 Answers   ATS, Infosys, UNI, Wipro,


What makes a language oop?

0 Answers  


How do you use inheritance in unity?

0 Answers  


2. Give the different notations for the class.\

0 Answers  


What is a friend function & its advantage?

2 Answers   TCS,


Contrast OOP and SOA. What are tenets of each?

1 Answers   Siebel Systems, Wipro,


Categories