Question
1.
1.
#ifndef Exercise_H
2.
#define Exercise_H
3.
int num = 842;
4.
#endif
1.
#include
2.
#include "exe.h"
3.
using namespace std;
4.
int main(int argc, char * argv[] )
5.
{
6.
cout
What will be the output of these two programs?
1.
1.
1.
#ifndef Exercise_H
2.
#define Exercise_H
3.
int num = 842;
4.
#endif
2.
1.
#include
2.
#include "exe.h"
3.
using namespace std;
4.
int main(int argc, char * argv[] )
5.
{
6.
cout
Answer: Option A
Was this answer helpful ?
In this program, we have created a header file and linked that into the source program and we
are post incrementing that because of that it is printed as 842.
Output:
$ g++ link.cpp
$ a.out
842
Was this answer helpful ?
Submit Solution