Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • The Dummy Programmer Robot
    • Overview
    • Version history & downloads
    • Tutorials
      • TDP Robot – The basics
      • A simple SQL Server backup solution
      • A simple SQL Server backup solution – A next step
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • Donate
  • About
  • Toggle search form

Category: Programming

Sum the first N numbers in your program

Today I want to talk about a little math trick… sum the first N numbers, where N is an arbitrary number of your choice. To do the job, you may be tempted to use a loop, something similar to the code below (in C#): int result = 0; for (int i = 1; i <=…

Read More “Sum the first N numbers in your program” »

Mathematics

Copyright © 2022 The Dummy Programmer | Privacy Policy |

Powered by PressBook Masonry Dark