You are here:

C++/convert pseudocode to C++ code


I'm new in programming.I do not know how to convert the pseudocode to sourse code.hope that u may help me.

below is the question in form of pseudocode.

2.Set PI = 3.14159
3.Read the radius
4.Calculate the area of a circle using the formula :
 Area= Radius x Radius x PI
5.Display area.

how to convert to C++ code?
do i need to make flowchart 1st?

thank you.

Hello Lina, thank you for the question.

Are you at all familiar with C++ syntax? Assigning variables and reading input from the keyboard?

It would go something like this:

int main()
float pi = 3.14159f;
float radius = 0.0f;

cout << "Enter the radius: ";
cin >> radius;

float area = radius * radius * pi;

cout << endl << "The radius is: " << radius << endl;

return 0;

This is a simple program, so a flow chart isn't necessary, in my opinion.

I hope this information was helpful.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 All rights reserved.