What will be the output of the following C++ code? #include<iostream> using…
BPSC TRE 2023
What will be the output of the following C++ code?
#include<iostream> using namespace std; long factorial (long a) { if (a > 1) return (a * factorial(a+1)); else return(1); } int main() { long num = 3; cout << num << "!=" << factorial(num); return 0; }
- A.
6
- B.
24
- C.
Segmentation fault
- D.
More than one of the above
- E.
None of the above
Attempted by 673 students.
Sign up free to check your answer
Sign up freeLoading lesson…

