fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {n,m,acarreo,c;
  5. scanf("%i %i", &n &m);
  6. if(a==0 && b==0)
  7. printf("");
  8. else
  9. if
  10. while(0<a || 0<b)
  11. {l1 = a % 10;
  12. l2 = b % 10;
  13. suma = l1 + l2 + c;
  14.  
  15. if(suma>=10)
  16. {acarreo++;
  17. c = 1;}
  18. else(acarreo==0)
  19. {printf("No carry operation.")}
  20. }
  21. n = n/10;
  22. m = m/10;
  23. }
  24. if(acarreo==0)
  25. {printf("No carry operation.");
  26. }
  27. if(acarreo>1)
  28. {printf("%i carry operations.");
  29. if(acarreo==1)
  30. {printf("1 carry operation.");
  31.  
  32.  
  33. return 0;
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:4:2: error: ‘n’ undeclared (first use in this function)
 {n,m,acarreo,c;
  ^
prog.c:4:2: note: each undeclared identifier is reported only once for each function it appears in
prog.c:4:4: error: ‘m’ undeclared (first use in this function)
 {n,m,acarreo,c;
    ^
prog.c:4:3: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 {n,m,acarreo,c;
   ^
prog.c:4:6: error: ‘acarreo’ undeclared (first use in this function)
 {n,m,acarreo,c;
      ^~~~~~~
prog.c:4:5: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 {n,m,acarreo,c;
     ^
prog.c:4:14: error: ‘c’ undeclared (first use in this function)
 {n,m,acarreo,c;
              ^
prog.c:4:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 {n,m,acarreo,c;
             ^
prog.c:6:5: error: ‘a’ undeclared (first use in this function)
  if(a==0 && b==0)
     ^
prog.c:6:13: error: ‘b’ undeclared (first use in this function)
  if(a==0 && b==0)
             ^
prog.c:7:10: warning: zero-length gnu_printf format string [-Wformat-zero-length]
   printf("");
          ^~
prog.c:10:4: error: expected ‘(’ before ‘while’
    while(0<a || 0<b)
    ^~~~~
prog.c:11:7: error: ‘l1’ undeclared (first use in this function)
      {l1 = a % 10;
       ^~
prog.c:12:7: error: ‘l2’ undeclared (first use in this function)
       l2 = b % 10;
       ^~
prog.c:13:7: error: ‘suma’ undeclared (first use in this function)
       suma = l1 + l2 + c;
       ^~~~
prog.c:19:7: error: expected ‘;’ before ‘{’ token
       {printf("No carry operation.")}
       ^
prog.c: At top level:
prog.c:24:2: error: expected identifier or ‘(’ before ‘if’
  if(acarreo==0)
  ^~
prog.c:27:2: error: expected identifier or ‘(’ before ‘if’
  if(acarreo>1)
  ^~
stdout
Standard output is empty