Question: What is the output of the following program? #include using namespace std; static int i = 1 0 0 ; void abc ( ) {

What is the output of the following program?
#include
using namespace std;
static int i =100;
void abc()
{
int i =8;
cout << "first ="<< i++<< endl;
}
int main()
{
int i =2;
abc();
cout << "second ="<< i << endl;
abc();
return 0;
}
a.
first =8
second =2
first =8
b.
first =8
second =2
c.
second =2
first =8
d.
first =8
second =2
first =9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!