Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class Foo
4.
{
5.
public:
6.
Foo(int i = 0){ _i = i;}
7.
void f()
8.
{
9.
cout
Options:
A .  Executed
B .  Error
C .  Runtime error
D .  None of the mentioned
Answer: Option A

In this program, We passes the value to the class and printing it.
Output:
$ g++ ptm4.cpp
$ a.out
Executed



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers