create a calculator using arithmetic operators
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!