Código
[/code]me pide hallar la inversa de un numero pero no me compila
#include <iostream> using namespace std; int inve_num(int num, int x){ if(num==0){ return 0; }else{ x=inve_num(num/10,x*10+num%); return x; } } int main () { int num; cout << "ingrese un numero: "; cin >> num; cout << "el numero invertido es: " << inve_num(num, 0) << endl; return 0; } error dice error: linea 11 expected primary-expression before´)´token[code=cpp]
#include <iostream>
using namespace std;
int inve_num(int num, int x){
if(num==0){
return 0;
}else{
x=inve_num(num/10,x*10+num%);
return x;
}
}
int main ()
{
int num;
cout << "ingrese un numero: ";
cin >> num;
cout << "el numero invertido es: " << inve_num(num, 0) << endl;
return 0;
}
error dice error: linea 11 expected primary-expression before´)´token