#include<stdio.h> main() { int n,i,sn=0; scanf("%d",&n); for(i=1;i<=n;i++) { sn+=i; } printf("%d",sn); }
Double click to view unformatted code.