tutorial number 2 : C# ( C sharp): this was the hw : Ask the user to type a series of *Positive* numbers. when the user type the number “0”. the series will stops.

source

8
Leave a Reply

avatar
8 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
IconRules32Hadesxo027Dark ReaperEkskrementerKuba Liszka Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
John Giles
Guest

Thank you I was doing the same homework with while loops to with the highest number and lowest number then average them.

Josy Pam
Guest

Sababa!!!! Thanks!

Waqas Ahmed
Guest

thanks sir plz makes more and more video concept base again thanks to you

Kuba Liszka
Guest

thanks

Ekskrementer
Guest

Can you try to explain to a dumb person what parse does? I honestly looked it up and it just doesn't make sense.

Dark Reaper
Guest

thank u men :DDD

Hadesxo027
Guest

Okay..lets sum it..You declared "Int avg=0;" (jeez..) but you forgot, if the result gives a fraction, then your code is not accurate.

one possible solution to your problem :
if you insist on to hold the Integer variable, then you should have made a type cast on the final result, such as –> Console.WriteLine("the avarage is : " + (double)avg / count++);

or you should have used " double "type in the declaration, and in this case, there is no need of type casting.

Cheers.

IconRules32
Guest

Thank You!