Sum until x
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace SumUntilX
{
public class Program
{
public static void Main()
{
int x = 5;
int result=0;
for(int i = 1;i<=x;i++)
{
result += i;
}
Console.WriteLine(result);
}
}
}
Comments
Post a Comment