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
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);
Decrement statement in another programming language:
Differences to: