Skip to main content

Data Type Modifiers

 As the name suggests, data type modifiers are used with fundamental data types to modify the length of data that a particular data type can hold.

Following 4 datatype modifiers are available in C++:

  • Signed
  • Unsigned
  • Short
  • Long


Comments

Popular posts from this blog

Selection statement

  If statement  If tests a particular condition, if the condition evaluates to true then set of statements under the body of 'if' statement will be executed otherwise it will be ignored by the compiler. Syntax : if(<condition>) {      statements; } <> : programmer defined If else statement If we use 'else' statement with 'if' statement then if the condition of 'if' statement evaluates to false, in that case body of else statement will be executed, otherwise it will be ignored. Syntax :  if(<condition>) {      statements; } else {     statements; } If-else-if ladder If we use 'else if' statement with 'if' statement then if any condition evaluates to true, in that case its associated statement will be executed and all other 'else if' and 'else' statement will be ignored by the compiler. Syntax :  if(<condition>) {      statements; } else if(<condition>) {    statements; } els...

Variables / Identifiers / Literals (Constants)

Variables These are the memory location which can store a value. As the name suggests, the value of a variable can vary during the whole program. In other words, variables are named storage locations whose value can be manipulated during program run. Example:  a = 5;  ✔ 5 = a;  ✖ a = a + 2; a = a + 10; Identifiers Name of variable, function, array, class etc created by the programmer are called as identifiers. Constants Data items that never change their value during a program run. integer constant character constant floating constant string-literal

Operators

  The operations are represented by operators and the object of the operation are referred to as operands. 5 types of operators: 1. Arithmetic Operator  Addition : 2 + 4 = 6 Subtraction : 2 - 4 = -2 Multiplication : 2 * 4 = 8 Division : 2 / 4 = 0 Modulus (remainder operator, used only with integer values) : 7 % 2 = 1 2. Increment (++) / Decrement (--) Operator Increment Operator increases its operand value by 1 while decrement operator decreases its operand value by 1.  They both have two types : Prefix : First it will increase (or decrease) the operand value by one and then participate in the operation. Postfix : First it will participate in the operation and then increase (or decrease) the operand value by 1. 3. Relational Operator They determine the relation among different operands. But they do not work with strings. 6 types of relational operator are: > greater than < less than >= greater than or equals to <= less than or equals to == equal to != not equ...