Site icon

Octave continue Statement


In this tutorial, we will learn about the Octave continue Statement. We can use the continue statement within the body of a loop.

Octave continue Statement

The continue statement is used to skip the rest of the loop statements in the current iteration of the loop and continue with the next iteration.


Let’s understand the concept with an example.
In this code snippet, we run the loop and want to skip the loop statement if the number is divisible by 5.


% Sample Octave Script 
% continue statement Demo
% Octave Tutorials -

%Clear environment

% for Loop 
for n= 1 : 10
  if(rem(n,5) ==0)
  fprintf('Number = %d \n',n);   

We can use the break statement to skip the entire loop.

Octave Tutorials

Octave Tutorial on this website can be found at:

More information on Octave can be found on the official website:

Exit mobile version