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