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 polymorphism means?

0 Answers  


Precompilation ?

1 Answers   emc2,


What is namespace?

15 Answers  


WHAT IS THE DIFFERENCE BETWEEN ABSTRUCTION AND ENCAPSULATION? PLEASE EXPLAIN IT.

7 Answers   ETH,


what is meant by files?

4 Answers   Infosys,






What are virtual classes?

0 Answers  


Program to check whether a word is in all capital letters

1 Answers  


What is conditional Compilation?

3 Answers   emc2, HCL,


What is constructor overloading in oop?

0 Answers  


What is polymorphism what is it for and how is it used?

0 Answers  


Write a program to multiply 3x3 matrics

1 Answers  


explain the concepts of oops?

1 Answers  


Categories