Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication20
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Pls import nr1: ");
- int nr1 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Pls import nr2: ");
- int nr2 = Convert.ToInt32(Console.ReadLine());
- int min = Math.Min(nr1, nr2);
- int max = Math.Max(nr1, nr2);
- int sum = 0;
- for(int i = min; i < max+1; i++)
- {
- sum += i;
- }
- Console.WriteLine("Total sum is {0}", sum);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement