#include <stdio.h>

int sum(int n);

int main() {
    int n;
    printf("%d\n",sum(n));
    return 0;
}

int sum(int n){
    
   int root=(n-1)*n ;
   return root;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: