C++ - decrement statement: --

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

--

Description

-- var ;

Input

compatible programing languages:
Visual C++ .NET

Examples

C++

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);

C++

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

C++

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

--

Description

var -- ;

Input

compatible programing languages:
Visual C++ .NET

Examples

C++

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);

C++

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

C++

Other pieces of example codes:
i--;
y--;
decrement statement in another programming language:
Differences to:
Languages: en hu cz sk