A symbolic constant is a constant with a name, numeric constants are unnamed and must be retyped in the code on each usage. Generally use of symbolic constants is preferred as it makes the code self documenting and allows the compiler to catch typing errors in constant usage.
Symbolic constants are constants that the programmer has decided to give a symbolic name (usually one with a meaning to make it easy to remember) so he does not have to retype the numeric value every time he needs it and risk making an error. Many coding standards require ALL constants to be symbolic constants, even if only used once in the program.
constants are values that does not chnage through out the program exceution..
It is an expression.
symbolic constants are constants represented by symbols.... constants are values that does not change through out the program execution. e.g #include<stdio.h> #include<conio.h> #define NUM 15 void main() { int a=NUM; printf("The constant is %d",a); getch(); } here #define is a preprocessor. its job is to replace all the entries named NUM as 15. So that the compiler works with the constant 15...
Symbolic constants are named constants like : final double PI = 3.14 ; They are constants because of the 'final' keywords, so they canNOT be reassigned a new value after being declared as final And they are symbolic , because they have a name A NON symbolic constant is like the value of '2' in expression int foo = 2 * 3
Write a program that defines symbolic constants for all of the days of the week. Create an array variable that uses the symbols as initializers. Comments are a must. For this part, you may not need to put any working code in .code segment. Initialization should be enough. 1. Comments are a must. 2. Plagiarism would automatically qualify for 0. You just have to submit the TWO (2) ".asm" files and they MUST compile
There are 4 constants.
Variables change, constants do not.
Integer constants Character constants Real/floating point constants String constants
The main two I can think of:It gives more meaning to the constant. eg using PI instead of 3.14159 makes it easier to understand what's going on when calculating things like a = PI * r * r;Should the constant for the program need to be changed, only one occurrence needs to be changed (in a header file) instead of all usages.
Coding constants in c means writing the constants in a certain way that the c language understands.
It's arbitrary. That's the way that constants are defined.