By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,192 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,192 IT Pros & Developers. It's quick & easy.

convert pseudocode langauge to c++ language

P: 1
// Start
// Declarations
// num SIZE = 10
// num NUMBERS[SIZE]
// num i
// num j
// num temp
// for i = 0 to SIZE - 1
// output "Please enter a number: "
// input NUMBERS[i]
// endfor
// for i = 0 to SIZE - 2
// for j = 0 to SIZE - 2
// if (NUMBERS[j] < NUMBERS[j+1])
// temp = NUMBERS[j]
// NUMBERS[j] = NUMBERS[j+1]
// NUMBERS[j+1] = temp
// endif
// endfor
// endfor
// output "Sorted List"
// output "==========="
// for i = 0 to SIZE - 1
// output "Number ", i + 1, ": ", NUMBERS[i]
// endfor
// Stop
Oct 25 '15 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
This code already compiles in C++. It's nothing but comments.

I suggest you write an empty main() and insert this code inside it. Then remove one //, compile and fix the error. Then remove the next //, compile and fix the error.

When the // are gone and it compiles, you are done.
Oct 25 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.