Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int funcstatic(int)
4.
{
5.
int sum = 0;
6.
sum = sum + 10;
7.
return sum;
8.
}
9.
int main(void)
10.
{
11.
int r = 5, s;
12.
s = funcstatic(r);
13.
cout
Options:
A .  10
B .  15
C .  error
D .  none of the mentioned
Answer: Option A

Eventhough we passed the value, we didn't caught to manipulate it, So it is printing as 10.
Output:
$ g++ res2.cpp
$ a.out
10




Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers