Preprocessor
- What is the output of this program?
#include
using namespace std;
#define Minimum(n,m) (((n)<(m)) ? n : m)
int main ()
{
float f1, f2;
f1 = 211.25;
f2 = 211.025;
cout <<"The minimum is " << Minimum(f1, f2) << endl;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
In this program, we are getting the minimum number using conditional operator.
- What is the mandatory preprocessor directive for c++?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
For a c++ program to execute, we need #include
.
- How many types of macros are there in c++?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
There are two types of macros. They are object-like and function-like.
- Which symbol is used to declare the preprocessor directives?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
# symbol is used to declare the preprocessor directives.
- which keyword is used to define the macros in c++?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
#define