fork download
  1. #include <stdio.h>
  2. int sum(int);
  3. int main(void) {
  4. // your code goes here
  5. int a=10,b;
  6. b=sum(a);
  7. printf("%d",b);
  8. return 0;
  9. }
  10.  
  11. int sum(int n){
  12. int i,x=0;
  13. for(i=1;i<=n;i++){
  14. x=x+i;
  15. }
  16. return x;
  17. }
  18.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
55