Macros

1

What is the other name of the macro?

A. scripted directive
B. executed directive
C. link directive
D. none of the mentioned

2

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    #define MAX 
4.
    int main()
5.
    {
6.
        int num;
7.
        num = ++MAX;
8.
        cout << num;
9.
        return 0;
10.
    }
A. 11
B. 10
C. compile time error
D. none of the mentioned

3

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    #define SquareOf(x) x * x
4.
    int main()
5.
    {
6.
        int x;
7.
        cout << SquareOf(x + 4);
8.
        return 0;
9.
    }

A. 16
B. 64
C. compile time error
D. none of the mentioned

4

What is the output of this program?

 
1.
    #include 
2.
    using namespace std;
3.
    int main ()
4.
    {
5.
        cout << "Value of __LINE__ : " << __LINE__ 
        << endl;
6.
        cout << "Value of __FILE__ : " << __FILE__ << endl;
7.
        cout << "Value of __DATE__ : " << __DATE__ << endl;
8.
        cout << "Value of __TIME__ : " << __TIME__ << endl;
9.
        return 0;
10.
    }
A. 5
B. Details about your file
C. compile time error
D. none of the mentioned

5

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    #define MIN(a,b) (((a)<(b)) ? a : b)
4.
    int main ()
5.
    {
6.
        float i, j;
7.
        i = 100.1;
8.
        j = 100.01;
9.
        cout <<"The minimum is " << MIN(i, j) << endl;
10.
        return 0;
11.
    }
A. 100.01
B. 100.1
C. compile time error
D. none of the mentioned