In: Computer Science
Take the following C++ program and translate it into PEP/9 assembly language
#include <iostream>
using namespace std;
int num;
char letter;
int main() {
cin >> num;
cin >> letter;
cout << "You inputted " << num << endl;
cout << "Option " << letter << endl;
if (letter == '*')
cout << "Multiplied by 2 " << num*2 << endl;
return 0;
}
Code in assembly language from c++
where we input variable num and letter which is then outputted and a multiplication action is performed.