Correct Answer - Option 2 :
34
34
7
#include <iostream.h>
int x = 7;
void showx ();
void showxagain ();
int main ()
{
showx (); // result as 34
showx (); // result as 34
showxagain (); // result as 7
}
void showx ()
{
int x = 34;
cout << x++ << endl; //display output 34 as x is a local variable
}
void showxagain ()
{
cout << x++ < endl; // display output 7 as x is global variable here so value of x will be 7
}
Therefore Answer will be Option 2 i.e,
34
34
7