Skip to content

Instantly share code, notes, and snippets.

@DeclanGas
Created June 23, 2022 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeclanGas/23fd4a7b413c8af14df6c8c3cc9042e6 to your computer and use it in GitHub Desktop.
Save DeclanGas/23fd4a7b413c8af14df6c8c3cc9042e6 to your computer and use it in GitHub Desktop.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int total = 0;
for (int i = 0; i <= 10; i++)
{
total += i;
}
printf("The total of the numbers from 1 to 10 is: %i\n", total);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment