Advertisement
janducev

Untitled

Oct 21st, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main () {
  5. int numero1;
  6. int numero2;
  7. int tmp;
  8. int salida;
  9.  
  10. printf("Dame 1 numero\n");
  11. scanf("%d",&numero1);
  12. getchar();
  13.  
  14. printf("Dame 2 numero\n");
  15. scanf("%d",&numero2);
  16. getchar();
  17.  
  18. tmp = numero2;
  19. salida = 0;
  20.  
  21. printf("%d x %d = ",numero1,numero2);
  22.  
  23. /*
  24. while(tmp>0){
  25. salida += numero1;
  26. printf("%d + ",numero1);
  27. tmp--;
  28. }
  29.  
  30. printf("\b\b = %d\n",salida);
  31. */
  32.  
  33. for(int a=numero2;a>0;a--){
  34. salida += numero1;
  35. printf("%d + ",numero1);
  36. }
  37.  
  38. printf("\b\b = %d\n",salida);
  39.  
  40. getchar();
  41. return(0);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement