What is the output of the code fragment below if
(3 pts) void fun(int X) { if (X == 0) return; fun(X/2); cout<
#include <iostream>
using namespace std;
void func (int x) {
if (x == 0) return;
func(x / 2);
cout << x % 2;
}
int main () {
func(5);
cout << endl;
func(10);
cout << endl;
func(3);
}
Comments
Leave a comment