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 a scope resolution operator?

5 Answers   HP, IBS,


What is difference between #define and const?

3 Answers   emc2,


what is new operator in c++

1 Answers  


How many types of access specifier in c# and vb.net?

1 Answers   Infosys,


what is abstract class ? when is used in real time ? give a exp

5 Answers  






What is abstract class in oops?

0 Answers  


define a string class. overload the operator == to compare two strings

2 Answers   Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,


What are the 4 pillars of oop?

0 Answers  


design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }

0 Answers  


i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????

4 Answers  


write a program for function overloading?

14 Answers   HCL, InfoCity, TATA,


What is public, protected, private?

6 Answers   IBS, Satyam,


Categories