Advertisement
MoNoLidThZ

whileLoopPractice5

Jul 8th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace whileLoopPractice5 {
  8.     class Program {
  9.         static void Main(string[] args) {
  10.             int i = 0, res = 0;
  11.             while(i <= 100) {
  12.                 res += i;
  13.                 i++;
  14.             }
  15.             Console.WriteLine("Summary of 1-100 = {0}",res);
  16.             Console.ReadKey();
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement