### How to conver pseudo code in algorithm?

How can I convert pseudo code in algorithm like this one:
"Question: Take 2 numbers from user n operator (+.-,*,division) , perform requested operation n display result."
Pseudo Code:
1. declare two variables(a,b) of type int(or anything u want)
2. declare an char variable n
3. prompt user to input value for a and b
4. store the values in respective variables
5. prompt user to input the operator(+,-,*,/)
6. store the value in n
7. declare an variable result of type int
7. if(n=='+')
result=a+b;
else if(n=='-')
result=a-b;
else if(n=='*')
result=a*b;
else if(n=='/')
result=a/b;
8. output the result to the screen
9. end
Can any one tell me the algorithm for this code....
You just wrote the algorithm, all you need is the syntax:
1. `int a, b;`
2. `char n' `
3. `cout << "Input a, then b: ";`
4. `cin >> a >> b;`
5. `cout << "Input the operator";`
6. `cin >> n;`
7. `int result; // Then your if/elseif statements here `
8. `cout << result"; `
9. `return 0;`
Topic archived. No new replies allowed.