フィルターのクリア

create a calculator using arithmetic operators

4 ビュー (過去 30 日間)
abdul rehman
abdul rehman 2020 年 4 月 28 日
コメント済み: abdul rehman 2020 年 4 月 28 日
a=input(prompt,'s');
c=2;
d=3;
h=6;
if a=='+'
e=c+d;
e
else
e=c-d;
e
end
what is wrong with this addition code?

採用された回答

KSSV
KSSV 2020 年 4 月 28 日
prompt = 'Enter sign:' ;
a=input(prompt,'s');
c=2;
d=3;
h=6;
if strcmp(a,'+')
e=c+d;
e
else
e=c-d;
e
end
  1 件のコメント
abdul rehman
abdul rehman 2020 年 4 月 28 日
Thank you so much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by