Explore topic-wise MCQs in C++ Programming.

This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the output of this program?
#include 
using namespace std;
#define Minimum(n,m) (((n) int main ()
{
float f1, f2;
f1 = 211.25;
f2 = 211.025;
cout < return 0;
}

A. 211.025
B. 211.25
C. Compilation Error
D. Runtime Error
E. None of these
Answer» B. 211.25
2.

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

A. 100
B. Compilation Error
C. Runtime Error
D. Garbage value
E. None of these
Answer» C. Runtime Error
3.

What is the output of this program?
#include 
using namespace std;
#define Function(id) cout << "The value of " #id " is "< int main()
{
int Num = 100;
Function(Num);
return 0;
}

A. The value of Num is 10
B. The value of Num is 100
C. The value of Num is 1000
D. Compilation Error
E. None of these
Answer» C. The value of Num is 1000
4.

What is the output of this program?
#include 
using namespace std;
#define funOfSquare(num) num * num
int main()
{
int num;
cout << funOfSquare(num + 12);
return 0;
}

A. 144
B. Compilation Error
C. Runtime Error
D. Garbage value
E. None of these
Answer» F.
5.

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;
}

A. Details about current file
B. Compilation Error
C. Runtime Error
D. Garbage value
E. None of these
Answer» B. Compilation Error
6.

What is the other name of the macro?

A. link directive
B. executed directive
C. scripted directive
D. All of above
E. None of these
Answer» D. All of above