Skip to content

Instantly share code, notes, and snippets.

@rkhang7
Created November 13, 2018 12:40
Show Gist options
  • Save rkhang7/5f0aa6e6357ec3d413c7c9129b7817d3 to your computer and use it in GitHub Desktop.
Save rkhang7/5f0aa6e6357ec3d413c7c9129b7817d3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <conio.h>
int main(int argc, char *argv[])
{
int n;
long long s=0;
printf("n=");scanf("%d",&n);
for(int i=1;i<=n;i++)
s=s+i;
printf("S(%d)=%ld",n,s);
getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment