This code to sum numbers, but it is only show the numbers. mean instead of sum : 1 2 3 4 = 10 . its only show the numbers. how to sum the numbers?
C#:
for (int x = 0; x < 5; x++)
{
int sum = 0;
Console.WriteLine(sum += x);
}
/*print on screen:
* 1
* 2
* 3
* 4
*/
Last edited by a moderator: