Question: #include using namespace std; void displayFibonacci ( int n ) { int a = 0 , b = 1 , next; for ( int i
#include
using namespace std;
void displayFibonacciint n
int a b next;
for int i ; i n; i
cout b ;
next a b;
a b;
b next;
cout endl;
int factorialint n
if n return ;
return n factorialn ;
int main
char choice;
do
int option;
cout "Menu:
;
cout Display Fibonacci Series
;
cout Compute Factorial
;
cout "Enter your choice: ;
cin option;
if option
int num;
cout "Enter a Number: ;
cin num;
displayFibonaccinum;
else if option
int num;
cout "Enter a Number: ;
cin num;
cout "Factorial of num is factorialnum endl;
else
cout "Invalid option. Please try again.
;
cout "Return to Main Menu? YN: ;
cin choice;
while choice Y choice y;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
