Integer constant :
Integer constant is nothing but a whole number
Integer constants are positive unless they are preceded by a minus sign (-).
3] An " integer constant " is decimal number. We can provide decimal value to the variable directly as follows:
Declaration int variable=value (decimal);
Example int A = 127 , B = -100;
Octal Number :
1] The number with base 8, is called octal number.
2 ] we can provide octal value to this variable by prefixing " 0 " to it as follow:
Declaration int variable = 0 value
Example int A = 0127, B = -0100;
Hexadecimal number:
1] The number with base 16,is calledhexadecimal number.
2] we can provide hexadecimal value to the variable by prefixing "0x (zero and x) to it as follow:
Declaration int variable= 0x value ;
Example int A=0x224, B= -88.93;
Real Number:
1] Real constant are often called floating point constant. It must have decimal point.
2] Real constant are possitive unless they are proceded by a minus sign(-).
3] The real constant could be written in to two forms, fractional and exponential from.
4] Ex: 88.055 , - 93.07 , 93.700 etc.
Declaration float variable = real_no;
Example float A= 88.05, B= 93.70;
Good
ReplyDelete