What is the output from the following program, using #define to create constants and macro - C++ Preprocessor

C++ examples for Preprocessor:Macro

Description

What is the output from the following program, using #define to create constants and macro

Demo Code

#include <iostream>
using namespace std;
#define AMT1 a+a+a/*  w w  w  .j  a  v a  2 s .  c o m*/
#define AMT2 AMT1 - AMT1
int main()
{
   int a=1;
   cout << "Amount is " << AMT2 << "\n";
   return 0;
}

Result


Related Tutorials