Question: #6 Trace the following program and show the output. #include #include #include void counting1(int); void counting2(int); void counting3(int); void main() { int temp; cout <
#6 Trace the following program and show the output.
#include
} void counting1(int n) { // Assume n is 5 to start with if (n > 0) { cout << setw(5) << n; counting1(n - 1); cout << setw(5) << n; } else cout << setw(5) << n; } void counting2(int m) // Assume m is 5 to start with { if (m >= 0) { cout << setw(5) << m; counting2(m - 1); }; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
