-
-
Save rkhang7/5f0aa6e6357ec3d413c7c9129b7817d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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