What is output by the following program include using std co

What is output by the following program? #include using std:: cout; using std:: endl; void f1(): int main() {int x = 0; cout

Solution

Answer:

Initially, x = 0

During call to f1, x = 3

At the end, x = 0

in main method and f1() method, we have \"x\" integer variable as local variable. so if we change the value of x in either of that methods that will not give impact on others. So im main method, we declared x variable value as 0 and not modified so x value will always be 0 in main method.

in f1() method, we declared x variable value as 3. so x value will be 3 in f1() method.

 What is output by the following program? #include using std:: cout; using std:: endl; void f1(): int main() {int x = 0; cout SolutionAnswer: Initially, x = 0 D

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site