Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Summation
- {
- static void Main()
- {
- Console.Write("Enter the value of n: ");
- int n = Convert.ToInt32(Console.ReadLine());
- int sum = 0;
- for (int i = 1; i <= n; i++)
- {
- sum += i;
- }
- Console.WriteLine("The Summation of n is: {0}", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement