Advertisement
timh52280

Multiplicacion recursiva

Dec 10th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. void multiplicar(int,int);
  5.  
  6. int main()
  7. {
  8.     multiplicar(5,5);
  9.     return 0;
  10. }
  11.  
  12. void multiplicar(int numero, int n)
  13. {
  14.     if(n >= 1)
  15.     {
  16.         multiplicar(numero,n-1);
  17.     }
  18.  
  19.     std::cout << numero << " x " << n << " = " << (numero * n) << std::endl;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement