Increment statement: ++, inc
It is a mathematical operation that is used to increase the number by one.++
Description
++ var ;
Input
- var - value receiver
Examples
Example
Increment statement the possible of use:i=0;
while (i<10) ++i;
x =0;
while (i<20)
{
i= i+2;
if (i==16)
{
continue;
}
x++;
}
++
Description
var ++ ;
Input
- var - value receiver
Examples
Example
Increment statement the possible of use:i=0;
while (i<10) ++i;
x =0;
while (i<20)
{
i= i+2;
if (i==16)
{
continue;
}
x++;
}
Example
Other pieces of example codes:while ( y <= 32 ) y++;
if (y < 100) x++;
i++;
i++;
x++;
i++;
inc
Description
inc (value receiver) ;
Input
- var - value receiver
Examples
Object Pascal
Increment statement the possible of use:i:=0;
while i<10 do inc(i);
x :=0;
while i<20 do
begin
i:= i+2;
if i=16 then
begin
continue
end;
inc(x);
end;
Object Pascal
Other pieces of example codes:repeat inc(i); if i=5 then break; until not i <10;
repeat inc(i); if i=3 then break; until (i=10);
while y <= 32 do inc(y);
if y < 100 then inc(x);
if y < 100 then inc(x);
inc(i);
Increment statement in another programming language: