- List<int> list = new List<int>();
- while (true)
- {
- int input = Convert.ToInt32(Console.ReadLine());
- if (input == -1)
- {
- break;
- }
- list.Add(input);
- }
Sum up the numbers on a list
hello a for loop code to add the total sum of this list??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Feb 14, 2020, 12:36 AM EST
Mngaro Mwazenje72 reputationPosted Feb 14, 2020, 1:09 AM EST
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Feb 14, 2020, 1:48 AM EST
Mngaro Mwazenje72 reputationPosted Feb 14, 2020, 2:27 AM EST
Avnish KumarRank #1,003 · 2K reputationPosted Feb 14, 2020, 3:22 AM EST
Bhawna TutejaRank #2,418 · 584 reputationPosted Feb 17, 2020, 5:31 PM EST
Siddharth GajbhiyeRank #376 · 6.7K reputationPosted Feb 17, 2020, 5:58 PM EST