#include <stdio.h> // int sum(int n){ // for(int i=1; i<n; i++){ // return n+sum(n-i); // } // } int main(){ int num; printf("enter the number\n"); scanf("%d",&num); printf("%d",(num*num + num)/2); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter