Commit 992778e3 authored by Administrator's avatar Administrator
Browse files

add const

parent 61aaaab2
#include <iostream>
using namespace std;
#define LENGTH 10
#define WIDTH 5
#define NEWLINE '\n'
int main()
{
int area;
area = LENGTH * WIDTH;
cout << area << " | defined by #define";
cout << NEWLINE;
// return 0;
const int CONS_LENGTH = 7;
const int CONS_WIDTH = 8;
const char CONS_NEWLINE = '\n';
// int area;
area = CONS_LENGTH * CONS_WIDTH;
cout << area << " | defined by const";
cout << NEWLINE;
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment