create a calculator using arithmetic operators
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
abdul rehman
am 28 Apr. 2020
Kommentiert: abdul rehman
am 28 Apr. 2020
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 Kommentare
Akzeptierte Antwort
KSSV
am 28 Apr. 2020
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Search Path finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!