SHARE
TWEET

Untitled

janducev Oct 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top