Decrement statement: --, dec

Decrement statement it is a mathematical operation that is used to decrease the number by one.

--

Description

-- var ;

Input

Compatible programing languages:
C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

Examples

Example

Even one example in what situations we can use the operation decrement statement:
i=10;
do --i; while ( i > 0);
do {
  i++;
  if (i==5)
    break;
} while ( i <10);

Example

Even one example in what situations we can use the operation decrement statement:
do --i; while ( i > 0);
j--;

Example

Other pieces of example codes:
while ( y >= 0 )  
      --y;
if ( x == 5 )
   --y;
repeat --i; until ( i == 0);

--

Description

var -- ;

Input

Compatible programing languages:
C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

Examples

Example

Even one example in what situations we can use the operation decrement statement:
i=10;
do --i; while ( i > 0);
do {
  i++;
  if (i==5)
    break;
} while ( i <10);

Example

Even one example in what situations we can use the operation decrement statement:
do --i; while ( i > 0);
j--;

Example

Other pieces of example codes:
i--;
i--;
y--;

dec

Description


Input

Compatible programing languages:
Pascal | Object Pascal | Free Pascal

Examples

Object Pascal

Even one example in what situations we can use the operation decrement statement:
i:=10;
repeat dec(i) until not i > 0;
repeat
  inc(i);
  if i=5 then
    break;
until not i <10;

Object Pascal

Even one example in what situations we can use the operation decrement statement:
repeat dec(i) until not i > 0;
dec(j);

Object Pascal

Other pieces of example codes:
if  x = 5 then
   dec(y);
while  y >= 0 do  
      dec(y)
dec(i)
repeat dec(i) until ( i = 0);
dec(y);
Decrement statement in another programming language:
Languages: en hu cz sk