#include<iostream.h>
int length(int num);
int reverse(int a);
int main()
{
int num,t,n;
num=1;
do
{
cout<<"enter number plees";
cin>>num;
}
while(num==0)
n=length(int num);
cout<<"the length is:"<<n;
t=reverse(int num);
cout<<the reverse is:"<<t;
return 0;
}
int length(int num)
{
int length;
int x=1;
if(x<num)
length=x++;
rrturn length(num-1);
}
int reverse(int a)
{
int temp;
length(int length);
for(int i=1;i<length;i++)
{
temp=length;
a=length-i;
}
rutern reverse(a-1);
}السؤال:
1-Write a recursive function that determine the length of a given integer number. (e.g. the length of 123 is 3, length of 9561 is 4 and so on).
2-Write a recursive function that reverse digits of a given integer number using the above function. (e.g. the reverse of 456 is 654, the reverse of 525 is 525 and so on).
اتمنى منكم التعوان معي وعدم الضحك :rolleyes: