1.  What is the other name of the macro ?


scripted directive
executed directive
link directive
none of the mentioned


Answer

 Option

When the compiler encounters a previously defined macro, it will take the result from that execution itself.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

2.  Which keyword is used to define the macros in c++ ?


macro
define
#define
none of the mentioned


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

3.  What is the output of this program ?
#include
using namespace std;
int main (
{
cout << ‘’Value of __LINE__ : ‘’ << __LINE__ << endl;
cout << ‘’Value of __FILE__ : ‘’ << __FILE__ << endl;
cout << ‘’Value of __DATE__ : ‘’ << __DATE__ << endl;
cout << ‘’Value of __TIME__ : ‘’ << __TIME__ << endl;
return 0;
}


5
Details about your file
compile time error
none of the mentioned


Answer

 Option

In this program, we are using the macros to print the information about the file.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

4.  What is the output of this program ?
#include
using namespace std;
#define SquareOf(x) x * x
int main()
{
int x;
cout << SquareOf(x + 4);
return 0;
}


16
64
compile time error
none of the mentioned


Answer

 Option

In this program, as we haven’t initiailzed the variable x, we will get a output of ending digit of 4.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

5.  What is the output of this program ?
#include
using namespace std;
#define MAX 10
int main()
{
int num;
num = ++MAX;
cout << num;
return 0;
}


11
10
compile time error
none of the mentioned


Answer

 Option

Macro Preprocessor only replaces occurance of macro symbol with macro symbol value, So we can’t increment the value.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report