Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
void addprint()
4.
{
5.
static int s = 1;
6.
s++;
7.
cout
Options:
A .  234
B .  111
C .  123
D .  235
Answer: Option A

The variable that is declared as static has a file scope.
Output:
$ g++ dec2.cpp
$ a.out
234



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers