Write a program to display sum, product and quotient of any two numbers.
Answers
Explanation:
REM PROGRAM TO DISPLAY SUM, DIFFERENCE, PRODUCT AND AVERAGE OF TWO NUMBERS. INPUT “ENTER FIRST NUMBER”; A. ...
DECLARE SUB SUM (A, B) DECLARE SUB DIFF (A, B) ...
SUB SUM (A, B) S = A + B. ...
SUB AVERAGE (A, B) AV = (A + B) / 2. ...
DECLARE FUNCTION SUM (A, B) ...
FUNCTION SUM (A, B) ...
FUNCTION DIFF (A, B) ...
FUNCTION PROD (A,
#ɪɴᴄʟᴜᴅᴇ <sᴛᴅɪᴏ.ʜ>
ɪɴᴛ ᴍᴀɪɴ(ᴠᴏɪᴅ)
{
ɪɴᴛ ᴏɴᴇ, ᴛᴡᴏ, s, ǫ, ᴍ;
s = ᴏɴᴇ+ᴛᴡᴏ
ǫ = ᴏɴᴇ/ᴛᴡᴏ
ᴍ = ᴏɴᴇ*ᴛᴡᴏ
ᴘʀɪɴᴛғ("ᴇɴᴛᴇʀ ғɪʀsᴛ ᴘᴏsɪᴛɪᴠᴇ ɪɴᴛᴇɢᴇʀ: ");
sᴄᴀɴғ("%ᴅ", &ᴏɴᴇ);
ᴘʀɪɴᴛғ("ᴇɴᴛᴇʀ sᴇᴄᴏɴᴅ ᴘᴏsɪᴛɪᴠᴇ ɪɴᴛᴇɢᴇʀ: ");
sᴄᴀɴғ("%ᴅ", &ᴛᴡᴏ);
ᴘʀɪɴᴛғ("ᴛʜᴇ ᴀᴅᴅɪᴛɪᴏɴ ᴏғ %ᴅ ᴀɴᴅ %ᴅ ɪs %ᴅ", ᴏɴᴇ, ᴛᴡᴏ, s);
ᴘʀɪɴᴛғ("ᴛʜᴇ ɪɴᴛᴇɢᴇʀ ᴅɪᴠɪsɪᴏɴ ᴏғ %ᴅ ᴅɪᴠɪᴅᴇᴅ ʙʏ %ᴅ ɪs %ᴅ", ᴏɴᴇ, ᴛᴡᴏ, ǫ);
ᴘʀɪɴᴛғ("ᴛʜᴇ ᴍᴜʟᴛɪᴘʟɪᴄᴀᴛɪᴏɴ ᴏғ %ᴅ ᴀɴᴅ %ᴅ ɪs %ᴅ", &ᴏɴᴇ, &ᴛᴡᴏ, ᴍ);
ʀᴇᴛᴜʀɴ ;