Pascal - decrement statement: dec

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

dec

Description


Input

compatible programing languages:
Object Pascal | Free Pascal

Examples

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;

Pascal

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

Pascal

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