I would like to be shown a bit about how to do while loops with increments
Hi there I have recently started using Dev c++ in my computer labs at school,
I know your not here to give the ansers to my work but i would
just like somebody to point me in the write direction
It took me a while to pick up the basics but I have more of a jist now.
But the while loops still baffle me!
In one of the sheets I have been given, part I;m stuck on asks:
write a while loop that will call a function that takes two numbers, one double and one int, and raises the first number to the power of second one and return the result. I have managed to do this part without the return the result? then
the next part is the part I really dont know what to do: the while loop needs to keep incrementing the int used in the function each time, this is meant to carry on untill the result of the function call exceeds 500?
the calculation part is also meant to be in a loop?
then an output line line needs to be included for each function call, to see the effect
please help, I am utterly stuck and have searched everywhere.
I was really starting to enjoy c ++ before i could majorly stuck for hours on end!
1) Wrong forum. Please read the title of the forum... Is it THAT difficult for someone to figure out where to post?
2) Use [CODE] tags. If you don't know how, please look in the articles database for a tutorial although I hope you can figure it out on your own.
3) This is C++. Why do you insist on coding in C if your using C++?
4 and last) An incrementing loop should more often than not be a for loop for convenience and apropriateness. It's possible with a while loop but its pointless in my honest opinion.