Computer Science, asked by ashoksah10011, 9 months ago

write a program in qbasic to calculate the total cost of 2 pens​

Answers

Answered by pareenjoshi
0

Explanation:

how many 1 pen prise ?

1 pen prise duble and two pen prise

Answered by mad210219
5

Program in qbasic to calculate the total cost of 2 pens​

Explanation:

We take the cost of each pen through the user

So we have to calculate cost of two pens

Basic formula:

We have to multiply the no of pens and cost for each pen

QBASE PROGRAM:

CLS

Input”enter cost of pen”; cost

Let totcost=cost*2

Print “the total cost =”; totcost

End

Example:

If the cost of each pen is 10 then

10\times2

Total cost is 20 is displayed

We start qbase program initiating  

CLS command  

We take input using Input method

Let is used to make caluclations among variables and sstore in another variable

Print is used to display to screen

Similar questions