[PHP]#include <iostream>
using namespace std;
void DecimalToBinary (int n);
int main()
{
int num;
cout<<"Enter a number in order to conver it to binary: ";
cin>>num;
cout<<"The result in binary is: ";
DecimalToBinary(num);
cout<<endl;
system("pause");
return 0;
}
void DecimalToBinary (int n){
if(n>0)
{
DecimalToBinary(n/2);
cout<<n%2;
}
}
[/PHP]
[COLOR=#b22222][SIZE=4][B]الحل صحيح 100%[/B][/SIZE][/COLOR]