fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,sum=0,n;
  6. printf("Enter the value of n");
  7. scanf("%d",&n);
  8. for(a=1;a<=n;a++)
  9. sum=sum+a*a;
  10. printf("%d",sum);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0.63s 2172KB
stdin
Standard input is empty
stdout
Enter the value of n1592532755