What will be the output of following functions if we call these-00766
This subjective question is related to the book/course vu cs504 Software Engineering - I. It can also be found in vu cs504 Mid Term Solved Past Paper No. 2.
Question 1: What will be the output of following functions if we call these functions three times?
void func1(){
int x = 0;
x++;
cout << x << endl;
}
void func2(){
static int x = 0 ;
x++;
cout << x << endl ;
}
1
1
1
Second Function Output
1
void func1(){
int x = 0;
x++;
cout << x << endl;
}
void func2(){
static int x = 0 ;
x++;
cout << x << endl ;
}
Answer:
First Function Output1
1
1
Second Function Output
1