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