trouble with while statements...what am i missing? - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: trouble with while statements...what am i missing?

  1. #16
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,459

    Re: trouble with while statements...what am i missing?

    Your average is only going to show integers. So the average of 2 and 3 is going to show as 2 not 2.5. When you do the division for the average, you should cast the int values to double so that the division yeilds a double result rather than an int result. You also have a couple of unused variables (counter and num).
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  2. #17
    Join Date
    Jan 2013
    Posts
    71

    Re: trouble with while statements...what am i missing?

    oh i didnt realize that for the avg, thanks! But yea i have to clean it up some before i submit it. i always seem to have garbage stuff after trying different things.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center