Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- Console.WriteLine("Enter in a number between 1-100.");
- int cMax = Convert.ToInt32(Console.ReadLine());
- int sum = 0;
- for(int i = 0; i <= cMax; i++)
- {
- sum += i;
- }
- Console.WriteLine(sum);
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement