Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int start = int.Parse(Console.ReadLine());
- int end = int.Parse(Console.ReadLine());
- int sum = 0;
- for (int i = start; i <= end; i++)
- {
- Console.Write($"{i} ");
- sum += i;
- }
- Console.WriteLine();
- Console.WriteLine($"Sum: {sum}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement