using System; class Program { publicstaticvoid Main(string[] args) { int number = 1; int sum = 0; while (number


using System;

class Program

{

publicstaticvoid Main(string[] args)

{

int number = 1;

int sum = 0;

while (number <=>

{

sum = sum+number;

number +=1;

}

Console.WriteLine("Sum of number from 1 to 1000 is "+sum);

}


Hello! This program is in C# and it adds all of the numbers from 1-1000. How can a piece of code be added to count from 1-1000 first and then adds the numbers? Thank you!


Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here