Question: What is output for PrintNum ( 2 5 ) ? void PrintNum ( int num ) { if ( num = = 0 ) return;

What is output for PrintNum(25)?
void PrintNum(int num){
if(num ==0)
return;
else{
int n = num %2;
cout << n;
PrintNum(num /2);
}
}
What is output for PrintNum(25)?
void PrintNum(int num){
if(num ==0)
return;
else{
int n = num %2;
cout << n;
PrintNum(num /2);
}
}
10011
11001
00110
01100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!