fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(void) {
  5. int n;
  6. printf("enter the number");
  7. scanf("%d",&n);
  8. printf("%d",squaresum(n));
  9. return 0;
  10. }
  11. int squaresum(int n)
  12. {
  13. return(n*(n+1)*2*n+1)/6;
  14. }
  15.  
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
enter the number229370