| ||||||||||
%Ver 1. i=0; while(i ~=10) disp(i); i = i + 1; end %Ver 2. i=0; while(i < 10) disp(i); i = i + 1; end
int i = 0; while(i != 10){ System.out.println(i); i++; }//Ver 1. int i = 0; while(i < 10){ System.out.println(i); i++; }//Ver 2.
%Ver 1. for i=0:1:9 disp(i); end %Ver 2. You can also omit the 1 for i=0:9 disp(i); end
for (int i=0; i<10; i++){ System.out.println(i); }//Ver 1. for (int i=0; i<=9; i++){ System.out.println(i); }//Ver 2.