forked from dibyendu415/DibsProjects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeriesplay.cpp
More file actions
40 lines (35 loc) · 911 Bytes
/
Copy pathSeriesplay.cpp
File metadata and controls
40 lines (35 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//Print the following Series using a menu driven program
//1. Fibonacci series
//2. n natural numbers
//3. n prime numbers
//4. n even numbers
//5. n pallindrome numbers
//Find Sum of the following
//6. 1+4+9+16+.....
//7. 1+2+6+24+120+.....
//8. 1/2+2/3+3/4+4/5+....
# include <iostream>
using namespace std;
int main()
{
int ch;
cout << "Enter option \n";
cout<<"1. Print Fibonacci series\n";
cout<<"2. n natural numbers\n";
cout<<"3. n prime numbers\n";
cout<<"4. n even numbers\n";
cout<<"5. n pallindrome numbers\n";
cout<<"6. 1+4+9+16+.....n";
cout<<"7. 1+2+6+24+120+.....\n";
cout<<"8. 1/2+2/3+3/4+4/5+....\n";
cin >> ch;
switch(ch)
{
case 1:
default:
// If the options is not 1-8, error message is shown
cout << "Error! Option is not correct";
break;
}
return 0;
}