Найти в Дзене
alexander industries

Калькулятор на qbasic

Код простейшего калькулятора на qbasic:

Declare sub summa

Declare sub raznost

Declare sub proizvedenie

Declare sub chastnoe

Call summa

Call raznost

Call proizvedenie

Call chastnoe

Sub summa

Input "", a

Print "+"

Input "", b

Print "="

Print a+b

End sub

Sub raznost

Input "", c

Print "-"

Input "", d

Print "="

Print c-d

End sub

Sub proizvedenie

Input "", e

Print "*"

Input "", f

Print "="

Print e*f

End sub

Sub chastnoe

Input "", g

Print "/"

Input "", h

Print "="

Print g/h

End sub