I have no clue on how to create an I-P-O program. an i have past the last 2 weeks trying to understand how to create one and i have 2 programs due by midnight in I-P-O form.
i tried that and the complier i have to use keeps giving the same error. I know how to create the programs in #include<iostream> form but when i put the programs in the other form and change the "int main" to void main i am always getting a "{"error that i do not know how to solve.
and when i look at my professors examples i get even more confused.
What are the errors? Can you copy and paste them here?
If your compiler refuses to compile void main() then there's not much you can do, other than go out looking for a broken compiler that will accept incorrect code. Depends on what happens if you tell your instructor he's wrong, I suppose.
You might be just plain out of luck. There should be no such file as iostream.h, so it's doomed from the start.
What more can we say? Your first code was correct, this second code is just plain wrong. If your instructor insists you produce wrong code, how you handle that is unfortunately not something we can help with.
Whilst I'm here, I note that you never actually put any values into input and
while (count<5);
is wrong; the semi-colon there marks the end of the while loop, so you have a while loop with nothing in it. Also, your statement implies that you want to loop something as long as count is less than 5, but you never change the value of count, so how will it ever stop?
thanks i thing that was the main error from the start because the complier that i have to use for these programs did not find any error after i deleted the semicolon after the loop.
It depends how many times you go round the loop, and how long each loop takes :)
If you suspect it's not running correctly, stick in something like:
cout << "Going round loop, count is now " << count << endl;
so that you can be sure your loop is actually looping.
Remember, if your loop will run until some condition is met (e.g. until count is 5 or more), you must do somehting in your loop to change the value of count. In your code above, your loop will run forever because you never change the value of count.