Object Pascal - Decrement statement: dec
Decrement statement it is a mathematical operation that is used to decrease the number by one.dec
Description
dec (value receiver) ;
Input
- var - value receiver
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:
Differences to: