Statements is missing there
Just check it where is error then please remove it..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Nov 12, 2013, 12:18 PM EST
Tell me have you declared variables k,size and array "a" if not then please declare them however it seems if you declared all variables then there is no error and one more thing that where is "i" if you have declared or storing index in i then store index id to i then it will work fine.
VulpesRank #55 · 29.2K reputationPosted Nov 12, 2013, 12:53 PM EST
Bearing in mind that arrays in C++ are always zero-based, if the size variable is intended to represent the size of the array, then the condition for the while statement should be k < size rather than k<= size.
You might also like to include << endl; after a[i] if you don't want the array elements to appear next to each other with no space between. This will then place them on separate lines.