SHARE
TWEET

Untitled

a guest Sep 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace ConsoleApplication4
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int max = 1000, sum = 0;
  10.             for (int i = 1; i < max; i++)
  11.             {
  12.                 if (i % 3 == 0) sum = sum + i;
  13.                 if (i % 5 == 0) sum = sum + i;
  14.             }
  15.             Console.WriteLine(sum);
  16.             Console.ReadLine();
  17.         }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top