CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 17 of 17
  1. #16
    Join Date
    Dec 2012
    Location
    England
    Posts
    491

    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.

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Bookmarks

Posting Permissions

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



HTML5 Development Center

Click Here to Expand Forum to Full Width