【課題2−3 if~else if~else

 

if~else if~else

else if構文を使うと,多者択一の処理ができる.

(構文)       if (条件1) {

                     1;

              }

              else if (条件2){

                     2;

              }

              ...

              else if (条件文n) {

                     n;

              }

              else {

                     m;

              }     

 

 

戻る