cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Some type of function Error
Some type of function Error
Oct 27, 2014 at 1:52am UTC
Sarah409
(22)
Hi,
I wrote a function to find the sum of an equation, but the output I keep getting is 0, when it should be 784 when x = 7. Can anyone tell me what is wrong?
Last edited on
Oct 27, 2014 at 2:06am UTC
Oct 27, 2014 at 2:02am UTC
mobotus
(275)
Line 19 needs to be
double
i = 0;
Oct 27, 2014 at 2:05am UTC
Sarah409
(22)
ok that worked thanks! can u explain why?
Oct 27, 2014 at 2:10am UTC
mobotus
(275)
1
2
3
double
i;
while
(i < someNum)
You need to initialize your loop control variable.
Topic archived. No new replies allowed.