Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
606 B
2
Indexable
Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Vnesi eden broj: ");
            int x = Convert.ToInt32(Console.ReadLine());
            int sum = 0;
 
            for(int i = 1; i <= x; i++)
            {
                sum += i;
            }
 
            Console.WriteLine("Zbirot na broevite od 1 do {0} e: {1}", x, sum);
            Console.Read();
        }
 
    }
}