Mathematical calculations in 4 programming languages

  1. In C programming

4. In QBASIC programming

CLS
INPUT β€œEnter the value of a”; a
INPUT β€œEnter the value of b”; b
c = a + b
IF a > b THEN
d = a -b
ELSE
d = b -a
END IF
e = a * b
IF a > b THEN
f = a / b
ELSE
f = b / a
END IF
PRINT β€œThe sum of β€œ; a; β€œand”; b; β€œis”; c
PRINT β€œThe subtraction of β€œ; a; β€œand”; b; β€œis”; d
PRINT β€œThe multiplication of β€œ; a; β€œand”; b; β€œis”; e
PRINT β€œThe division of β€œ; a; β€œand”; b; β€œis”; f
END

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store