C++ program to find area using constants and defines
#include<iostream>
using namespace std;
#define length 13
#define width 20
const int len = 13;
const int wid = 20;
int main()
{
cout<<"\n Area using #define : " << length * width;
cout<<"\n Area using constants : "<< len * wid;
return 0;
}
using namespace std;
#define length 13
#define width 20
const int len = 13;
const int wid = 20;
int main()
{
cout<<"\n Area using #define : " << length * width;
cout<<"\n Area using constants : "<< len * wid;
return 0;
}
OUTPUT:
Area using #define : 260
Area using constants : 260
Area using constants : 260