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