fork download
  1. #include<stdio.h>
  2. #include<math.h>
  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+pow(a,3);
  10. printf("\n1^3+2^3+....+%d^3= %d\n",n,sum);
  11. return 0;
  12. }
  13.  
  14.  
Time limit exceeded #stdin #stdout 15s 2172KB
stdin
Standard input is empty
stdout
Standard output is empty