+ 2

Did I do it wrong?

int num, sum = 0, count = 0; Console.WriteLine("press number and in the end press 0 "); num = int.Parse(Console.ReadLine()); while (num != 0) { count++; sum += num; num = int.Parse(Console.ReadLine()); } Console.WriteLine("at all the count is: " + count); Console.WriteLine("the sum is: " + sum);

24th Dec 2021, 6:53 PM
ℭ𝔬𝔡𝔢 𝔅𝔯𝔢𝔞𝔨𝔢𝔯
ℭ𝔬𝔡𝔢 𝔅𝔯𝔢𝔞𝔨𝔢𝔯 - avatar
2 ответов
+ 2
https://www.sololearn.com/learning/2585/ Read the part about accepting an int as input.
26th Dec 2021, 12:39 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Can someone tells me if i did it wrong?
24th Dec 2021, 7:18 PM
ℭ𝔬𝔡𝔢 𝔅𝔯𝔢𝔞𝔨𝔢𝔯
ℭ𝔬𝔡𝔢 𝔅𝔯𝔢𝔞𝔨𝔢𝔯 - avatar